com.ibm.dtfj.java
Interface JavaClass


public interface JavaClass

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.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()
           
 JavaClass getSuperclass()
           
 int hashCode()
           
 boolean isArray()
           
 

Method Detail

getObject

JavaObject getObject()
                     throws CorruptDataException
Returns:
the java.lang.Class object associated with this class
Throws:
CorruptDataException

getClassLoader

JavaClassLoader getClassLoader()
                               throws CorruptDataException
Fetch the class loader associated with this class. Classes defined in the bootstrap class loader (including classes represenintg primitive types or void) will always return a JavaClassLoader representing the bootstrap class loader. This assymmetry with java.lang.Class#getClassLoader() is intentional.

Returns:
the JavaClassLoader in which this class was defined
Throws:
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
Returns:
the name of the class in the form: "full/package/class$innerclass"
Throws:
CorruptDataException

getSuperclass

JavaClass getSuperclass()
                        throws CorruptDataException
Returns:
the immediate superclass of this class, or null if this class has no superclass. For interfaces, Object, primitive types and void null is always returned.
Throws:
CorruptDataException

getInterfaces

java.util.Iterator getInterfaces()
Returns:
an iterator over the collection of the names of interfaces directly implemented by this class. Some JVM implementations may choose to load interfaces lazily, so only the names are returned. The JavaClass objects may be found through the defining class loader.
See Also:
String, JavaClassLoader.findClass(String), CorruptData

getModifiers

int getModifiers()
                 throws CorruptDataException
Return the Java language modifiers for this class. 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.

Returns:
the modifiers for this class
Throws:
CorruptDataException

isArray

boolean isArray()
                throws CorruptDataException
Returns:
true if this class is an array class
Throws:
CorruptDataException

getComponentType

JavaClass getComponentType()
                           throws CorruptDataException
For array classes, returns a JavaClass representing the component type of this array class.

Returns:
a JavaClass representing the component type of this array class
Throws:
java.lang.IllegalArgumentException - if this JavaClass does not represent an array class
CorruptDataException

getDeclaredFields

java.util.Iterator getDeclaredFields()
Returns:
an iterator over the collection of fields declared in this class.
See Also:
JavaField, CorruptData

getDeclaredMethods

java.util.Iterator getDeclaredMethods()
Returns:
an iterator over the collection of methods declared in this class.
See Also:
JavaMethod, CorruptData

getConstantPoolReferences

java.util.Iterator getConstantPoolReferences()
Returns:
an iterator over the collection of JavaObjects which are referred to by the constant pool of this class
See Also:
JavaObject, CorruptData

getID

ImagePointer getID()
The ID of a class is a pointer to a section of memory which identifies the class. The contents of this memory are implementation defined.

Returns:
a pointer to the class

equals

boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Parameters:
obj -
Returns:
True obj refers to the same Java Class in the image

hashCode

int hashCode()
Overrides:
hashCode in class java.lang.Object