Global information including the parent class, implemented interfaces, and access flags are also provided since this information is often necessary. Implicitly declared (aka mandated) and synthetic members are included as well.
Note that a parent class and interface may exist outside of the scope of the index (e.g. classes in a different jar) so the references are stored as names instead of direct references. It is expected that multiple indexes may need to be queried to assemble a full hierarchy in a complex multi-jar environment (e.g. an application server).
Thread-Safety
This class is immutable and can be shared between threads without safe publication.| Modifier and Type | Class and Description |
|---|---|
| public static class | ClassInfo.EnclosingMethodInfo
Provides information on the enclosing method or constructor for a local or anonymous class, if available. |
| private static class | |
| public static enum | ClassInfo.NestingType
Describes the form of nesting used by a class |
| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private static final byte[] | |
| private byte[] | |
| private FieldInternal[] | |
| private short | |
| private boolean | |
| private Type[] | |
| private static final int | |
| private Set | |
| private byte[] | |
| private MethodInternal[] | |
| private final DotName | |
| private ClassInfo. | |
| private byte[] | |
| private RecordComponentInternal[] | |
| private Type | |
| private Type[] |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public final AnnotationInstance | Returns: the annotation instance, ornull if not foundname of the annotation type to look for, must not be name)nullImplements org. |
| public final List | Returns: immutable list of annotation instances, nevernullname of the annotation type, must not be name)nullImplements org. |
| public final List | Returns: immutable list of annotation instances, nevernullImplements org. |
| public final Map | |
| public final Map | Returns: immutable map of annotations specified on this class and its elements, nevernullReturns a map indexed by annotation name, with a value list of annotation instances. |
| public final List | Returns: immutable list of annotation instances, nevernullname of the annotation type, must not be name, IndexView nullindex used to obtain the annotation type, must not be index)nullImplements org. |
| public ClassInfo | asClass()
Implements org. ClassInfo if it is of kind CLASS
|
| public FieldInfo | asField()
Implements org. FieldInfo if it is of kind FIELD
|
| public MethodInfo | asMethod()
Implements org. MethodInfo if it is of kind METHOD
|
| public MethodParameterInfo | asMethodParameter()
Implements org. MethodParameterInfo if it is of kind METHOD_PARAMETER
|
| public RecordComponentInfo | asRecordComponent()
Implements org. RecordComponentInfo if it is of kind RECORD_COMPONENT
|
| public TypeTarget | asType()
Implements org. TypeTarget if it is of kind TYPE
|
| public final AnnotationInstance | Returns: the declared annotation or null if not foundthe annotation name to look for name)
Deprecated
use
Returns the annotation with the specified name directly declared on this class.
declaredAnnotation(DotName)
|
| public final Collection | Returns: immutable list of annotations declared on this class
Deprecated
use
Returns a list of all annotations directly declared on this class.
declaredAnnotations()
|
| public final List | Returns: immutable list of annotation instances declared on this class, or an empty list if nonethe name of the annotation name, IndexView the index used to obtain the annotation class index)
Deprecated
use
Retrieves annotation instances declared on this class, by the name of the annotation.
declaredAnnotationsWithRepeatable(DotName, IndexView)
|
| public final List | Returns: the list of constructors declared in this classReturns a list of all constructors declared in this class (which have the special name |
| pack-priv final Type[] | |
| public static ClassInfo | Returns: a new mock class representationthe name of this class name, DotName the name of the parent class superName, short the class attributes flags, DotName[] the interfaces this class implements interfaces, Map<DotName, List<AnnotationInstance>> the annotations on this class annotations, boolean whether this class has a no arg constructor hasNoArgsConstructor)
Deprecated
Constructs a "mock" ClassInfo using the passed values.
|
| public final AnnotationInstance | Returns: the annotation instance, ornull if not foundname of the annotation type to look for, must not be name)nullImplements org. |
| public final List | Returns: immutable list of annotation instances, nevernullImplements org. |
| public final List | Returns: immutable list of annotation instances, nevernullname of the annotation type, must not be name, IndexView nullindex used to obtain the annotation type, must not be index)nullImplements org. |
| public String | Returns: the bytecode descriptor of this class's typea substitution function from type variable identifiers to types typeVariableSubstitution)Implements org. |
| public DotName | Returns: the enclosing class if this class is a member classReturns the enclosing class if this is a member class, or |
| public ClassInfo. | Returns: the enclosing method/constructor, if this class is a local or anonymous class declared within a method or constructor, otherwisenullReturns the enclosing method of this class if it is a local or anonymous class declared within the body of a method or constructor. |
| pack-priv final int | |
| public final List | Returns: immutable list of enum constants, nevernullReturns a list of enum constants declared by this enum class, represented as |
| public final FieldInfo | |
| pack-priv final FieldInternal[] | |
| pack-priv final byte[] | |
| public final List | |
| public final MethodInfo | Returns: the first discovered method matching this name, or null if no match is foundthe name of the method name)Retrieves the "first" occurrence of a method by the given name. |
| public final short | |
| public String | Returns: a generic signature of this class with type variables substituted, nevernulla substitution function from type variable identifiers to types typeVariableSubstitution)Implements org. |
| public final boolean | Returns: true if the annotation is present, false otherwisename of the annotation type to look for, must not be name)nullImplements org. |
| public final boolean | Returns: true if the annotation is present, false otherwisename of the annotation type to look for, must not be name)nullImplements org. |
| public final boolean | Returns: true if this class has a zero-parameter constructor, false if it does notReturns whether this class declares a zero-parameter constructor. |
| public final List | Returns: immutable list of names of interfaces implemented by this classReturns a list of names for all interfaces this class implements. |
| public final DotName[] | Returns: an array of interface names implemented by this class
Deprecated
Returns an array of interface names implemented by this class.
|
| pack-priv final Type[] | |
| public final List | Returns: immutable list of types declared in theimplements clause of this classReturns the list of types in the |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final boolean | |
| public final AnnotationTarget. | kind()
Implements org. |
| public Set | Returns: immutable set of names of this class's member classes, nevernullReturns a set of names of member classes declared in this class. |
| public final MethodInfo | |
| pack-priv final MethodInternal[] | |
| pack-priv final byte[] | |
| public final List | Returns: the list of methods declared in this classReturns a list of all methods declared in this class. |
| public ModuleInfo | Returns: the module descriptor for module classes, otherwisenullReturns the module information from this class if it is a module descriptor, i.e. |
| public final DotName | |
| pack-priv String | |
| public ClassInfo. | Returns: the nesting type of this classReturns the nesting type of this class, which could either be a standard top level class, a member class
( |
| public final RecordComponentInfo | Returns: the record componentthe name of the record component name)Retrieves a record component by the given name. |
| pack-priv final RecordComponentInternal[] | |
| pack-priv final byte[] | |
| public final List | Returns: a list of record componentsReturns a list of all record components declared by this class. |
| public boolean | Returns: whether this class must have a generic signatureImplements org. |
| pack-priv final void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public String | Returns: the simple name of a top-level, member or local class, ornull if this is an anonymous classReturns the source declared name of this class if it is a top-level class, member class or a local class. |
| pack-priv static < An internal member type, FieldInternal or MethodInternal T> byte[] | Returns: an array offsets in the array of internals in the order prior to sortingArray of internal types set on the ClassInfo instance internals, Comparator<T> Comparator used to sort internals and locate original positions comparator, NameTable NameTable used to intern byte arrays of member positions names)Sorts the array of internals using the provided comparator and returns an array of offsets in the original order of internals. |
| public final Type | Returns: the super class type definition in the extends clauseReturns a super type represented by the extends clause of this class. |
| public final DotName | Returns: the name of the super class of this class, or null if this class isjava.lang.ObjectReturns the name of the super class declared by the extends clause of this class. |
| public String | Returns: the binary name of this classOverrides java. |
| pack-priv final Type[] | |
| public final List | Returns: immutable list of generic type parameters of this classReturns the generic type parameters of this class, if any. |
| public final List | Returns: a list of fieldsReturns a list of all fields declared in this class, in the declaration order. |
| public final List | Returns: a list of methodsReturns a list of all methods declared in this class, in the declaration order. |
| public final List | Returns: a list of record componentsReturns a list of all record components declared in this class, in the declaration order. |