public final class ClassFileReader
extends java.lang.Object
Constructor and Description |
---|
ClassFileReader()
Constructs a new
ClassFileReader instance. |
Modifier and Type | Method and Description |
---|---|
static ClassFileReader |
newInstance()
Returns a new
ClassFileReader instance. |
ClassFile |
readClassFile(java.lang.Class<?> clazz)
Returns a
ClassFile representation of clazz , by reading its binary data. |
ClassFile |
readClassFile(java.io.DataInput dataInput)
Returns a
ClassFile , by reading some binary data from dataInput . |
ClassFile |
readClassFile(java.io.File file)
Returns a
ClassFile , by reading some binary data given a File . |
ClassFile |
readClassFile(java.lang.String className)
Returns a
ClassFile representation of the Class that can be obtained by Class.forName(className) , by reading its binary data. |
public ClassFileReader()
ClassFileReader
instance.public ClassFile readClassFile(java.lang.Class<?> clazz)
ClassFile
representation of clazz
, by reading its binary data.
If clazz
is null
, a NullPointerException
will be thrown.
If the read binary data is invalid for some reason, a NodeFormatException
will be thrown.
clazz
- the Class
from which to read binary data into a ClassFile
instanceClassFile
representation of clazz
, by reading its binary dataNodeFormatException
- thrown if, and only if, the read binary data is invalidjava.lang.NullPointerException
- thrown if, and only if, clazz
is null
public ClassFile readClassFile(java.io.DataInput dataInput)
ClassFile
, by reading some binary data from dataInput
.
If dataInput
is null
, a NullPointerException
will be thrown.
If the read binary data is invalid for some reason, a NodeFormatException
will be thrown.
dataInput
- the DataInput
from which to read binary data into a ClassFile
instanceClassFile
, by reading some binary data from dataInput
NodeFormatException
- thrown if, and only if, the read binary data is invalidjava.lang.NullPointerException
- thrown if, and only if, dataInput
is null
public ClassFile readClassFile(java.io.File file)
ClassFile
, by reading some binary data given a File
.
If file
is null
, a NullPointerException
will be thrown.
If the read binary data is invalid for some reason, a NodeFormatException
will be thrown.
file
- the File
from which to read binary data into a ClassFile
instanceClassFile
, by reading some binary data given a File
NodeFormatException
- thrown if, and only if, the read binary data is invalidjava.lang.NullPointerException
- thrown if, and only if, file
is null
public ClassFile readClassFile(java.lang.String className)
ClassFile
representation of the Class
that can be obtained by Class.forName(className)
, by reading its binary data.
If className
is null
, a NullPointerException
will be thrown.
If the read binary data is invalid for some reason, or no such Class
exists, a NodeFormatException
will be thrown.
className
- the name of the Class
from which to read binary data into a ClassFile
instanceClassFile
representation of the Class
that can be obtained by Class.forName(className)
, by reading its binary dataNodeFormatException
- thrown if, and only if, the read binary data is invalid, or no such Class
existsjava.lang.NullPointerException
- thrown if, and only if, className
is null
public static ClassFileReader newInstance()
ClassFileReader
instance.ClassFileReader
instance