|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dtfj.analyzer.util.ClassScanner
public class ClassScanner
A class that simplifies the process of getting the contents of object fields. The field descriptors of the class are cached and thus instances of the class can be rapidly scanned. In particular it is possible to visit all the object references made by an instance and this can optionally include the references made by superclasses.
Constructor Summary | |
---|---|
ClassScanner(com.ibm.dtfj.java.JavaClass cls)
Build a scanner on the given JavaClass. |
Method Summary | |
---|---|
com.ibm.dtfj.java.JavaField |
getField(java.lang.String name,
boolean includeSuperclass)
Return the field with the given name and optionally search the superclass |
int |
getIntegerField(com.ibm.dtfj.java.JavaObject obj,
java.lang.String name,
boolean includeSuperclass)
Get the content of an integer field. |
com.ibm.dtfj.java.JavaClass |
getJavaClass()
Get the java class that this scanner describes |
long |
getLongField(com.ibm.dtfj.java.JavaObject obj,
java.lang.String name,
boolean includeSuperclass)
Get the content of a long field |
java.lang.String |
getName()
Get the class name that this Scanner operates on. |
com.ibm.dtfj.java.JavaField[] |
getObjectInstanceFields(boolean includeSuperclass)
Get the set of primitive instance fields defined on this class and optionally include the superclass chain. |
com.ibm.dtfj.java.JavaField[] |
getPrimitiveInstanceFields(boolean includeSuperclass)
Get the set of primitive instance fields defined on this class and optionally include the superclass chain. |
boolean |
hasFinalizer()
Does this class define a finalizer |
boolean |
isPrimitiveType(java.lang.String type)
Return true if the given type is primitive (boolean, byte, short etc.) |
boolean |
isSubclassOf(com.ibm.dtfj.java.JavaClass c)
Is the class represented by this scanner a subclass of the given class - if so return true else false. |
java.lang.String |
toString()
(non-Javadoc) |
void |
visitReferences(com.ibm.dtfj.java.JavaObject obj,
ObjectObserver obs,
java.lang.Object context)
Visit all the references from the given object which must match the class of this scanner. |
void |
visitReferencesFast(com.ibm.dtfj.java.JavaObject obj,
ObjectObserver obs,
java.lang.Object context)
Visit all the references from the given object which must match the class of this scanner. |
void |
visitStaticReferences(ObjectObserver obs,
java.lang.Object context)
Trace the static fields and build roots if the root set is non null |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassScanner(com.ibm.dtfj.java.JavaClass cls)
cls
- Method Detail |
---|
public com.ibm.dtfj.java.JavaClass getJavaClass()
public boolean isPrimitiveType(java.lang.String type)
type
- the type name
public boolean hasFinalizer()
public java.lang.String getName()
public void visitReferences(com.ibm.dtfj.java.JavaObject obj, ObjectObserver obs, java.lang.Object context)
visitReferencesFast(JavaObject obj, ObjectObserver obs, Object context)
obj
- the object to scan for referencesobs
- the observer to pass the references tocontext
- a context which will be passed to the object processing routinepublic void visitReferencesFast(com.ibm.dtfj.java.JavaObject obj, ObjectObserver obs, java.lang.Object context)
visitReferences(JavaObject obj, ObjectObserver obs, Object context)
)
obj
- the object to scan for referencesobs
- the observer to pass the references tocontext
- a context which will be passed to the object processing routinepublic void visitStaticReferences(ObjectObserver obs, java.lang.Object context)
obs
- the observer to pass the references tocontext
- a context which will be passed to the object processing routinepublic com.ibm.dtfj.java.JavaField[] getPrimitiveInstanceFields(boolean includeSuperclass)
includeSuperclass
- should we look for a superclass field ?
public com.ibm.dtfj.java.JavaField[] getObjectInstanceFields(boolean includeSuperclass)
includeSuperclass
- should we look for a superclass field ?
public com.ibm.dtfj.java.JavaField getField(java.lang.String name, boolean includeSuperclass)
name
- includeSuperclass
-
public int getIntegerField(com.ibm.dtfj.java.JavaObject obj, java.lang.String name, boolean includeSuperclass) throws com.ibm.dtfj.image.CorruptDataException, com.ibm.dtfj.image.MemoryAccessException
obj
- the object to get the field content fromname
- the field name to getincludeSuperclass
- should we look for a superclass field ?
com.ibm.dtfj.image.MemoryAccessException
com.ibm.dtfj.image.CorruptDataException
public long getLongField(com.ibm.dtfj.java.JavaObject obj, java.lang.String name, boolean includeSuperclass) throws com.ibm.dtfj.image.CorruptDataException, com.ibm.dtfj.image.MemoryAccessException
obj
- the object to get the field content fromname
- the field name to getincludeSuperclass
- should we look for a superclass field ?
com.ibm.dtfj.image.MemoryAccessException
com.ibm.dtfj.image.CorruptDataException
public boolean isSubclassOf(com.ibm.dtfj.java.JavaClass c)
c
- the class to test
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |