public class ClassFile extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ClassFile.Attribute |
class |
ClassFile.ClassConstantData |
class |
ClassFile.ClassField |
class |
ClassFile.ClassMethod |
class |
ClassFile.FieldMethod |
static class |
ClassFile.UtfStringConstant
Create and add to dependancies the referenced classes.
|
Modifier and Type | Field and Description |
---|---|
int |
accessFlags |
static int |
CONSTANT_Class |
static int |
CONSTANT_Double |
static int |
CONSTANT_Fieldref |
static int |
CONSTANT_Float |
static int |
CONSTANT_Integer |
static int |
CONSTANT_InterfaceMethodref |
static int |
CONSTANT_Long |
static int |
CONSTANT_Methodref |
static int |
CONSTANT_NameAndType |
static int |
CONSTANT_String |
static int |
CONSTANT_Utf8 |
ClassFile.ClassConstantData |
constantData |
ByteArray |
data
The data bytes for the class file.
|
Hashtable |
fields |
boolean |
hasNativeMethods |
String[] |
interfaces |
Class |
loadedClass |
Hashtable |
methods |
String |
name
The name of the class file.
|
int |
size
The size of the class file.
|
String |
superClassName |
Constructor and Description |
---|
ClassFile(ByteArray data) |
ClassFile(Class forClass) |
ClassFile(File file) |
Modifier and Type | Method and Description |
---|---|
String |
className()
Return the class name in the '.' format.
|
boolean |
equals(Object other)
Returns if this object is considered equal to the other object.
|
Vector |
getAllReferencedClasses(Vector addTo)
Return all the referenced classes as a Vector of Strings.
|
ClassFile.Attribute |
getAttributeAt(int byteIndexInClassFile) |
Vector |
getAttributesAt(int byteIndexOfAttributesCount,
Vector destination) |
boolean |
getClassInfo() |
protected String |
getClassName()
Return the class name in the '/' format.
|
File |
getClassPathFrom(File source)
Assuming this ClassFile was loaded from the specified source - find out what the
base directory for the class is.
|
int |
getFieldsAndMethods() |
String |
getString(int index) |
protected ClassFile.UtfStringConstant |
getUtfString(int offset) |
int |
hashCode()
Returns a hashCode for the object.
|
void |
loadFieldsAndMethods() |
String |
toString()
Return all the referenced classes as a Vector of Strings.
|
public ByteArray data
public int size
public String name
public boolean hasNativeMethods
public static final int CONSTANT_Utf8
public static final int CONSTANT_Integer
public static final int CONSTANT_Float
public static final int CONSTANT_Long
public static final int CONSTANT_Double
public static final int CONSTANT_Class
public static final int CONSTANT_String
public static final int CONSTANT_Fieldref
public static final int CONSTANT_Methodref
public static final int CONSTANT_InterfaceMethodref
public static final int CONSTANT_NameAndType
public int accessFlags
public String superClassName
public String[] interfaces
public Class loadedClass
public ClassFile.ClassConstantData constantData
public Hashtable fields
public Hashtable methods
public ClassFile(ByteArray data)
public ClassFile(File file) throws IOException
IOException
public ClassFile(Class forClass)
public String getString(int index)
public void loadFieldsAndMethods()
public int getFieldsAndMethods()
public ClassFile.Attribute getAttributeAt(int byteIndexInClassFile)
public boolean getClassInfo()
public Vector getAllReferencedClasses(Vector addTo)
addTo
- The vector to add to. Can be null.protected ClassFile.UtfStringConstant getUtfString(int offset)
public String toString()
public File getClassPathFrom(File source)
protected String getClassName()
public String className()
public boolean equals(Object other)
Object
public int hashCode()
Object