TypeDescription
or as a TypeDescription.Generic
.
Modifier and Type | Class and Description |
---|---|
public static enum | TypeDefinition.Sort
Represents a |
public static class | TypeDefinition.SuperClassIterator
An iterator that iterates over a type's class hierarchy. |
Modifier and Type | Field and Description |
---|---|
public static final String | RAW_TYPES_PROPERTY
If this property is set to |
Modifier and Type | Method and Description |
---|---|
public TypeDescription | |
public TypeDescription. | Returns: This type definition represented as a generic type.Returns this type definition as a generic type. |
public TypeDefinition | Returns: The component type of this type ornull if this type does not represent an array type.Returns the component type of this type. |
public FieldList | Returns: The fields that this type declares. A super type is only defined for non-generic types (Sort#NON_GENERIC ),
parameterized types (Sort#PARAMETERIZED ) or generic array types (Sort#GENERIC_ARRAY ) types. Generic array
types never define methods and the returned list is always empty for such types.Returns the fields that this type declares. |
public MethodList | Returns: The methods that this type declares.Returns the methods that this type declares. |
public TypeList. | Returns: The interfaces that this type implements.Returns the interfaces that this type implements. |
public RecordComponentList | Returns: A list of record components that this type declares.Returns the list of record components that are declared by this type. |
public TypeDefinition. | Returns: The sort of the generic type.Returns the sort of the generic type this instance represents. |
public StackSize | Returns: The size of the type described by this instance.Returns the size of the type described by this instance. |
public TypeDescription. | Returns: The super class of this type ornull if no super class exists for this type.Returns the super class of this type. |
public String | |
public boolean | Returns: true if this type description represents an array.Checks if the type described by this entity is an array. |
public boolean | Returns: true if this type description represents a primitive type.Checks if the type described by this entity is a primitive type. |
public boolean | |
public boolean | Returns: true if the type described by this instance represents type .The type of interest. type)Checks if the type described by this instance represents |
RAW_TYPES_PROPERTY | back to summary |
---|---|
public static final String RAW_TYPES_PROPERTY
If this property is set to Setting this property can be useful if generic type information is not required in order to avoid bugs in implementations of the JVM where processing generic types can cause segmentation faults. Byte Buddy will undertake a best effort to retain the generic type information and information about type annotations within the redefined types' class files. Typically, this property can be meaningful in combination with a Java agent that only changes byte code without changing a class type's structure. |
asErasure | back to summary |
---|---|
public TypeDescription asErasure() Returns the erasure of this type. Wildcard types (
|
asGenericType | back to summary |
---|---|
public TypeDescription. Returns this type definition as a generic type.
|
getComponentType | back to summary |
---|---|
public TypeDefinition getComponentType() Returns the component type of this type.
Only non-generic types (
|
getDeclaredFields | back to summary |
---|---|
public FieldList Returns the fields that this type declares. A super type is only defined for non-generic types (
|
getDeclaredMethods | back to summary |
---|---|
public MethodList Returns the methods that this type declares.
|
getInterfaces | back to summary |
---|---|
public TypeList. Returns the interfaces that this type implements. A super type is only defined for non-generic types ( |
getRecordComponents | back to summary |
---|---|
public RecordComponentList Returns the list of record components that are declared by this type. If this type is not a record, the returned list is empty.
|
getSort | back to summary |
---|---|
public TypeDefinition. Returns the sort of the generic type this instance represents.
|
getStackSize | back to summary |
---|---|
public StackSize getStackSize() Returns the size of the type described by this instance. Wildcard types
(
|
getSuperClass | back to summary |
---|---|
public TypeDescription. Returns the super class of this type. A super type is only defined for non-generic types (
|
getTypeName | back to summary |
---|---|
public String getTypeName() Returns the name of the type. For generic types, this name is their
|
isArray | back to summary |
---|---|
public boolean isArray() Checks if the type described by this entity is an array.
|
isPrimitive | back to summary |
---|---|
public boolean isPrimitive() Checks if the type described by this entity is a primitive type.
|
isRecord | back to summary |
---|---|
public boolean isRecord() Checks if this type is a Java record.
|
represents | back to summary |
---|---|
public boolean represents(Type type) Checks if the type described by this instance represents
|
TypeDescription.Generic
's form.
Modifier and Type | Class and Description |
---|---|
protected static interface | TypeDefinition.Sort.AnnotatedType
A proxy for interacting with |
Modifier and Type | Field and Description |
---|---|
private static final TypeDefinition. | ANNOTATED_TYPE
A dispatcher for interacting with |
public static final TypeDefinition. | GENERIC_ARRAY
Represents a generic array type. |
public static final TypeDefinition. | NON_GENERIC
Represents a non-generic type. |
public static final TypeDefinition. | PARAMETERIZED
Represents a parameterized type. |
public static final TypeDefinition. | VARIABLE
Represents a type variable that is attached to a |
public static final TypeDefinition. | VARIABLE_SYMBOLIC
Represents a type variable that is merely symbolic and is not attached to a |
public static final TypeDefinition. | WILDCARD
Represents a wildcard type. |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public static TypeDescription. | Returns: A description of the provided generic type.The type to describe. type)Describes a loaded generic type as a |
protected static TypeDescription. | Returns: A description of the provided generic annotated type.The type to describe. type, TypeDescription.The annotation reader for extracting type annotations. annotationReaderDescribes the generic type while using the supplied annotation reader for resolving type annotations if this language feature is available on the current JVM. |
public static TypeDescription. | Returns: A description of the provided generic type.The annotatedType)java.lang.reflect.AnnotatedType to describe.Describes a loaded |
private static < The type of the action's resolved value. T> T | Returns: The action's resolved value.The action to execute from a privileged context. action)A proxy for |
public boolean | Returns: true if this type sort represents a generic array.Checks if this type sort represents a generic array. |
public boolean | Returns: true if this sort form represents a non-generic.Checks if this type sort represents a non-generic type. |
public boolean | Returns: true if this sort form represents a parameterized type.Checks if this type sort represents a parameterized type. |
public boolean | Returns: true if this type sort represents an attached type variable.Checks if this type sort represents a type variable of any form. |
public boolean | Returns: true if this type sort represents a wildcard.Checks if this type sort represents a wildcard. |
public static TypeDefinition. | |
public static TypeDefinition. |
ANNOTATED_TYPE | back to summary |
---|---|
private static final TypeDefinition. A dispatcher for interacting with |
GENERIC_ARRAY | back to summary |
---|---|
public static final TypeDefinition. Represents a generic array type. |
NON_GENERIC | back to summary |
---|---|
public static final TypeDefinition. Represents a non-generic type. |
PARAMETERIZED | back to summary |
---|---|
public static final TypeDefinition. Represents a parameterized type. |
VARIABLE | back to summary |
---|---|
public static final TypeDefinition. Represents a type variable that is attached to a |
VARIABLE_SYMBOLIC | back to summary |
---|---|
public static final TypeDefinition. Represents a type variable that is merely symbolic and is not attached to a |
WILDCARD | back to summary |
---|---|
public static final TypeDefinition. Represents a wildcard type. |
Sort | back to summary |
---|---|
private Sort() |
describe | back to summary |
---|---|
public static TypeDescription. Describes a loaded generic type as a
|
describe | back to summary |
---|---|
protected static TypeDescription. Describes the generic type while using the supplied annotation reader for resolving type annotations if this language feature is available on the current JVM.
|
describeAnnotated | back to summary |
---|---|
public static TypeDescription. Describes a loaded
|
doPrivileged | back to summary |
---|---|
private static <T> T doPrivileged(PrivilegedAction<T> action) A proxy for
|
isGenericArray | back to summary |
---|---|
public boolean isGenericArray() Checks if this type sort represents a generic array.
|
isNonGeneric | back to summary |
---|---|
public boolean isNonGeneric() Checks if this type sort represents a non-generic type.
|
isParameterized | back to summary |
---|---|
public boolean isParameterized() Checks if this type sort represents a parameterized type.
|
isTypeVariable | back to summary |
---|---|
public boolean isTypeVariable() Checks if this type sort represents a type variable of any form.
|
isWildcard | back to summary |
---|---|
public boolean isWildcard() Checks if this type sort represents a wildcard.
|
valueOf | back to summary |
---|---|
public static TypeDefinition. |
values | back to summary |
---|---|
public static TypeDefinition. |
java.lang.reflect.AnnotatedType
.
Modifier and Type | Method and Description |
---|---|
public Type | Returns: The annotated type's type.The value)java.lang.reflect.AnnotatedType to resolve.Resolves the supplied |
public boolean | Returns: true if the supplied instance is of type java.lang.reflect.AnnotatedType .The instance to consider. value)Returns |
getType | back to summary |
---|---|
public Type getType(AnnotatedElement value) Resolves the supplied
|
isInstance | back to summary |
---|---|
public boolean isInstance(AnnotatedElement value) Returns
|
Modifier and Type | Field and Description |
---|---|
private TypeDefinition | nextClass
The next class to represent. |
Access | Constructor and Description |
---|---|
public | SuperClassIterator(TypeDefinition
The initial type of this iterator. initialType)Creates a new iterator. |
Modifier and Type | Method and Description |
---|---|
public boolean | |
public TypeDefinition | |
public void | remove()
Overrides default java. |
nextClass | back to summary |
---|---|
private TypeDefinition nextClass The next class to represent. |
SuperClassIterator | back to summary |
---|---|
public SuperClassIterator(TypeDefinition initialType) Creates a new iterator.
|
hasNext | back to summary |
---|---|
public boolean hasNext() Implements java. Doc from java. Returns
|
next | back to summary |
---|---|
public TypeDefinition next() Implements java. Doc from java. Returns the next element in the iteration.
|
remove | back to summary |
---|---|
public void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the |