com.ibm.dtfj.java
Interface JavaClass
- public interface JavaClass
Method Summary
Modifier and Type | Method and Description |
---|---|
|
equals(java.lang.Object obj)
|
getClassLoader()
Fetch the class loader associated with this class.
|
|
getComponentType()
For array classes, returns a JavaClass representing the component type of this array class.
|
|
|
getConstantPoolReferences()
Java classes may refer to other classes and to String objects via
the class's constant pool.
|
|
getDeclaredFields()
Get the set of fields declared in this class.
|
|
getDeclaredMethods()
Get the set of methods declared in this class.
|
getID()
The ID of a class is a pointer to a section of memory which identifies
the class.
|
|
|
getInstanceSize()
Returns the size in bytes of an instance of this class on the heap.
|
|
getInterfaces()
Get the set of names of interfaces directly implemented by this class.
|
|
getModifiers()
Return the Java language modifiers for this class.
|
|
getName()
Get the name of the class.
|
getObject()
Fetch the java.lang.Class object associated with this class.
|
|
|
getReferences()
Get the set of references from this class.
|
getSuperclass()
Get the immediate superclass of this class.
|
|
|
hashCode()
|
|
isArray()
Is this an array class ?
|
Method Detail
getObject
- JavaObject getObject()
- throws CorruptDataException
getClassLoader
- 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) getName
- java.lang.String getName()
- throws CorruptDataException
getSuperclass
- JavaClass getSuperclass()
- throws CorruptDataException
getInterfaces
- java.util.Iterator getInterfaces( )
getModifiers
- 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.
isArray
- boolean isArray()
- throws CorruptDataException
getComponentType
- JavaClass getComponentType()
- throws CorruptDataException
java.lang.IllegalArgumentException
- if this JavaClass does not represent an array class getDeclaredFields
- java.util.Iterator getDeclaredFields( )
getDeclaredMethods
- java.util.Iterator getDeclaredMethods( )
getConstantPoolReferences
- 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 constant pool.
getID
- 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 this 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.
getReferences
- java.util.Iterator getReferences( )
equals
- boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- getInstanceSize
- long getInstanceSize()
- throws DataUnavailable
- CorruptDataException
The call is only meaningful for a non-array JavaClass, where all instances of the class are of the same size. If this method is called on a JavaArrayClass, where instances can be of different sizes, an UnsupportedOperationException will be thrown. DataUnavailable can be thrown if no value is available: for example when DTFJ is examining a javacore, where the instance size for a class is not recorded.
DataUnavailable,
- CorruptDataException java.lang.UnsupportedOperationException
- if the JavaClass is an instance of JavaArrayClass hashCode
- int hashCode()
hashCode
in class java.lang.Object
In some implementations this may be null if no object has been created to represent this class, or if the class is synthetic.