Interface ClassDescriptor


public interface ClassDescriptor
A descriptor for a class, interface, array, or primitive type.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves 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.
    long
    id()
    Retrieves a unique identifier of the class.
    boolean
    Determines if this descriptor represents a java.lang.Class object in the heap dump.
    boolean
    Determines if this descriptor represents an instance of a class in the heap dump.
    boolean
    Determines if the type represented by this descriptor is an array of objects.
    boolean
    Determines if the type represented by this descriptor is an array of a primitive type.
    boolean
    Determines if this descriptor represents java.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

      @NotNull String 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

      @NotNull String 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 represents java.lang.String.
      Returns:
      true if java.lang.String, false otherwise.
    • isClassObject

      boolean isClassObject()
      Determines if this descriptor represents a java.lang.Class object 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

      @Nullable ClassDescriptor superClass()
      Retrieves the descriptor representing the superclass of the class described by this descriptor.
      Returns:
      the ClassDescriptor of the superclass, or null if no superclass exists or is applicable.
    • declaredInstanceFields

      @NotNull List<String> 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

      @NotNull List<String> 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

      @NotNull List<String> 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.