public class ClassInfo
extends java.lang.Object
Constructor and Description |
---|
ClassInfo(java.io.InputStream stream)
Loads a class file from the given
InputStream . |
Modifier and Type | Method and Description |
---|---|
void |
dump(java.io.OutputStream stream)
Dumps a textual representation of this
ClassInfo to the given OutputStream . |
AccessFlag |
getAccessModifiers()
Gets this class's access modifiers.
|
AttributeStructure[] |
getAttributes()
Gets this class's attributes.
|
java.lang.String |
getBaseName()
Gets the unqualified name of this class.
|
byte[] |
getBytes()
Gets the bytes comprising this class.
|
ConstantStructure[] |
getConstantPool()
Returns this class's constant pool.
|
FieldInfo[] |
getFields()
Gets this class's field pool.
|
ConstantStructure |
getFromPool(byte... offset) |
ConstantStructure |
getFromPool(int offset) |
int |
getMajorVersion()
Gets this class's major version.
|
MethodInfo[] |
getMethods()
Gets this class's field pool.
|
int |
getMinorVersion()
Gets this class's major version.
|
java.lang.String |
getName()
Gets the qualified name of this class.
|
java.lang.String |
getPackage()
Gets the package of this class.
|
java.lang.String |
getSuperName()
Gets the qualified name of this class's superclass.
|
void |
loadClassInfo()
Loads the class and superclass info.
|
void |
loadFields() |
void |
loadMethods() |
public ClassInfo(java.io.InputStream stream) throws java.lang.IllegalStateException, java.io.IOException
InputStream
.stream
- The stream to load the class file fromjava.lang.IllegalStateException
- If the stream does not begin with the standard magic numberjava.io.IOException
- If an exception occurs while reading the streampublic java.lang.String getPackage()
public java.lang.String getName()
public java.lang.String getBaseName()
public java.lang.String getSuperName()
public AccessFlag getAccessModifiers()
public int getMajorVersion()
public int getMinorVersion()
public FieldInfo[] getFields()
public MethodInfo[] getMethods()
public AttributeStructure[] getAttributes()
public byte[] getBytes()
public ConstantStructure[] getConstantPool()
public void loadClassInfo()
public void loadFields()
public void loadMethods()
public void dump(java.io.OutputStream stream) throws java.io.IOException
ClassInfo
to the given OutputStream
.stream
- The OutputStream
to write tojava.io.IOException
- If an exception occurs while writing to the OutputStream
public ConstantStructure getFromPool(int offset)
public ConstantStructure getFromPool(byte... offset)