|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a Java class.
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
JavaClassLoader |
getClassLoader()
Fetch the class loader associated with this class. |
JavaClass |
getComponentType()
For array classes, returns a JavaClass representing the component type of this array class. |
java.util.Iterator |
getConstantPoolReferences()
Java classes may refer to other classes and to String objects via the class's constant pool. |
java.util.Iterator |
getDeclaredFields()
|
java.util.Iterator |
getDeclaredMethods()
|
ImagePointer |
getID()
The ID of a class is a pointer to a section of memory which identifies the class. |
java.util.Iterator |
getInterfaces()
|
int |
getModifiers()
Return the Java language modifiers for this class. |
java.lang.String |
getName()
|
JavaObject |
getObject()
Fetch the java.lang.Class object associated with this class. |
JavaClass |
getSuperclass()
|
int |
hashCode()
|
boolean |
isArray()
|
Method Detail |
public JavaObject getObject() throws CorruptDataException
In some implementations this may be null if no object has been created to represent this class, or if the class is synthetic.
CorruptDataException
getID()
public JavaClassLoader getClassLoader() throws CorruptDataException
CorruptDataException
- if the class loader for this class cannot
be found (a class cannot exist without a loader so this implies corruption)public java.lang.String getName() throws CorruptDataException
CorruptDataException
public JavaClass getSuperclass() throws CorruptDataException
CorruptDataException
public java.util.Iterator getInterfaces()
String
,
JavaClassLoader.findClass(String)
,
CorruptData
public int getModifiers() throws CorruptDataException
The modifiers are defined by the JVM Specification.
Note that, for inner classes, the actual modifiers are returned, not the synthetic modifiers. For instance, a class will never have its 'protected' modifier set, even if the inner class was a protected member, since 'protected' is not a legal modifier for a class file.
CorruptDataException
public boolean isArray() throws CorruptDataException
CorruptDataException
public JavaClass getComponentType() throws CorruptDataException
java.lang.IllegalArgumentException
- if this JavaClass does not represent an array class
CorruptDataException
public java.util.Iterator getDeclaredFields()
JavaField
,
CorruptData
public java.util.Iterator getDeclaredMethods()
JavaMethod
,
CorruptData
public java.util.Iterator getConstantPoolReferences()
Although Java VMs typically permit only Class and String objects in the constant pool, some esoteric or future virtual machines may permit other types of objects to occur in the constant pool. This API imposes no restrictions on the types of JavaObjects which might be included in the Iterator.
No assumption should be made about the order in which constant pool references are returned.
Classes may also refer to objects through static variables. These may be found with the getDeclaredFields() API. Objects referenced by static variables are not returned by getConstantPoolReferences() unless the object is also referenced by the costant pool.
JavaObject
,
CorruptData
public ImagePointer getID()
In some implementations getID() and getObject().getID() may return the same value. This implies that the class object is also the primary internal representation of the class. DTFJ users should not rely on thie behaviour.
In some implementations, getID() may return null for some classes. This indicates that the class is a synthetic class which has been constructed for DTFJ purposes only. The class has no physical representation in the VM.
public boolean equals(java.lang.Object obj)
obj
-
public int hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |