Package com.jprofiler.api.agent.heap
Interface ClassDescriptor
public interface ClassDescriptor
A descriptor for a class, interface, array, or primitive type.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves a list of all instance fields present in the class described by this descriptor.Retrieves a list of declared instance fields for the class described by this descriptor.Returns the field descriptor for a class, interface, array, or primitive type according to the Java Virtual Machine Specification.Retrieves the display name as shown in JProfiler of the type represented by this descriptor.longid()Retrieves a unique identifier of the class.booleanDetermines if this descriptor represents ajava.lang.Classobject in the heap dump.booleanDetermines if this descriptor represents an instance of a class in the heap dump.booleanDetermines if the type represented by this descriptor is an array of objects.booleanDetermines if the type represented by this descriptor is an array of a primitive type.booleanisString()Determines if this descriptor representsjava.lang.String.Retrieves a list of static field names for the class described by this descriptor.Retrieves the descriptor representing the superclass of the class described by this descriptor.
-
Method Details
-
id
long id()Retrieves a unique identifier of the class.- Returns:
- a long value representing the unique identifier
-
displayName
Retrieves the display name as shown in JProfiler of the type represented by this descriptor.- Returns:
- a non-null string representing the display name of the type.
-
descriptor
Returns the field descriptor for a class, interface, array, or primitive type according to the Java Virtual Machine Specification. A field type descriptor string for a non-array type is either a one-letter code corresponding to a primitive type ("J", "I", "C", "S", "B", "D", "F", "Z", "V"), or the letter"L", followed by the fully qualified binary name of a class, followed by";". A field type descriptor for an array type is the character"["followed by the field descriptor for the component type. Examples of valid type descriptor strings include"Ljava/lang/String;","I","[I","V","[Ljava/lang/String;", etc.- Returns:
- a non-null string representing the field descriptor of the type.
-
isObjectArray
boolean isObjectArray()Determines if the type represented by this descriptor is an array of objects.- Returns:
- true if the type is an array of objects, false otherwise.
-
isPrimitiveArray
boolean isPrimitiveArray()Determines if the type represented by this descriptor is an array of a primitive type.- Returns:
- true if the type is an array of a primitive type, false otherwise.
-
isString
boolean isString()Determines if this descriptor representsjava.lang.String.- Returns:
- true if java.lang.String, false otherwise.
-
isClassObject
boolean isClassObject()Determines if this descriptor represents ajava.lang.Classobject in the heap dump.- Returns:
- true if the descriptor represents a class object, false otherwise.
-
isInstance
boolean isInstance()Determines if this descriptor represents an instance of a class in the heap dump.- Returns:
- true if the descriptor represents a class instance, false otherwise.
-
superClass
Retrieves the descriptor representing the superclass of the class described by this descriptor.- Returns:
- the
ClassDescriptorof the superclass, ornullif no superclass exists or is applicable.
-
declaredInstanceFields
Retrieves a list of declared instance fields for the class described by this descriptor. Declared instance fields are the fields directly defined in this class, excluding those inherited from superclasses or static fields.If field information is unavailable, the list is empty.
- Returns:
- a non-null list of strings where each string represents the name of an instance field declared in this class.
-
allInstanceFields
Retrieves a list of all instance fields present in the class described by this descriptor. This list includes both declared fields and inherited instance fields from superclasses. Static fields are excluded.If field information is unavailable, the list is empty.
- Returns:
- a non-null list of strings where each string represents the name of an instance field available in this class and its superclasses.
-
staticFields
Retrieves a list of static field names for the class described by this descriptor.If field information is unavailable, the list is empty.
- Returns:
- a non-null list of strings where each string represents the name of a static field declared in this class.
-