Package net.bytebuddy.description.type
Class TypeDescription.Latent
- java.lang.Object
-
- net.bytebuddy.description.ModifierReviewable.AbstractBase
-
- net.bytebuddy.description.TypeVariableSource.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.AbstractBase.OfSimpleType
-
- net.bytebuddy.description.type.TypeDescription.Latent
-
- All Implemented Interfaces:
java.lang.Iterable<TypeDefinition>
,AnnotationSource
,ByteCodeElement
,DeclaredByType
,ModifierReviewable
,ModifierReviewable.ForFieldDescription
,ModifierReviewable.ForMethodDescription
,ModifierReviewable.ForParameterDescription
,ModifierReviewable.ForTypeDefinition
,ModifierReviewable.OfAbstraction
,ModifierReviewable.OfByteCodeElement
,ModifierReviewable.OfEnumeration
,NamedElement
,NamedElement.WithDescriptor
,NamedElement.WithRuntimeName
,TypeDefinition
,TypeDescription
,TypeVariableSource
- Enclosing interface:
- TypeDescription
public static class TypeDescription.Latent extends TypeDescription.AbstractBase.OfSimpleType
A latent type description for a type without methods or fields.
Important: This type does not define most of its properties and should only be used as a simple placeholder. For more complex placeholders, use an
InstrumentedType.Default
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.description.type.TypeDescription.AbstractBase.OfSimpleType
TypeDescription.AbstractBase.OfSimpleType.WithDelegation
-
Nested classes/interfaces inherited from class net.bytebuddy.description.type.TypeDescription.AbstractBase
TypeDescription.AbstractBase.OfSimpleType
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.Explicit
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement
ByteCodeElement.Token<T extends ByteCodeElement.Token<T>>, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDefinition
TypeDefinition.Sort, TypeDefinition.SuperClassIterator
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDescription
TypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.Generic, TypeDescription.Latent, TypeDescription.SuperTypeLoading
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<? extends TypeDescription.Generic>
interfaces
The interfaces that this type implements.private int
modifiers
The modifiers of the type.private java.lang.String
name
The name of the type.private TypeDescription.Generic
superClass
The super type ornull
if no such type exists.-
Fields inherited from class net.bytebuddy.description.type.TypeDescription.AbstractBase
RAW_TYPES
-
Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
-
Fields inherited from interface net.bytebuddy.description.NamedElement
EMPTY_NAME, NO_NAME
-
Fields inherited from interface net.bytebuddy.description.NamedElement.WithDescriptor
NON_GENERIC_SIGNATURE
-
Fields inherited from interface net.bytebuddy.description.type.TypeDefinition
RAW_TYPES_PROPERTY
-
Fields inherited from interface net.bytebuddy.description.type.TypeDescription
ARRAY_INTERFACES, CLASS, OBJECT, STRING, THROWABLE, UNDEFINED, VOID
-
Fields inherited from interface net.bytebuddy.description.TypeVariableSource
UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description Latent(java.lang.String name, int modifiers, TypeDescription.Generic superClass, java.util.List<? extends TypeDescription.Generic> interfaces)
Creates a new latent type.Latent(java.lang.String name, int modifiers, TypeDescription.Generic superClass, TypeDescription.Generic... anInterface)
Creates a new latent type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationList
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.FieldList<FieldDescription.InDefinedShape>
getDeclaredFields()
Returns the fields that this type declares.MethodList<MethodDescription.InDefinedShape>
getDeclaredMethods()
Returns the methods that this type declares.TypeList
getDeclaredTypes()
Returns a list of types that are declared by this type.TypeDescription
getDeclaringType()
Returns the declaring type of this instance.MethodDescription.InDefinedShape
getEnclosingMethod()
Returns a description of the method that encloses this type.TypeDescription
getEnclosingType()
Returns a description of this type's enclosing type if any.TypeList.Generic
getInterfaces()
Returns the interfaces that this type implements.int
getModifiers()
Returns the modifier that is described by this object.java.lang.String
getName()
Returns the internalName of this byte code element.TypeDescription
getNestHost()
Returns the nest host of this type.TypeList
getNestMembers()
Returns a list of members that are part of a nesting group.PackageDescription
getPackage()
Returns the package of the type described by this instance ornull
if the described type does not imply a package.TypeList
getPermittedSubclasses()
Returns the list of permitted subclasses if this class is a sealed class or an empty list if this class is not sealed.RecordComponentList<RecordComponentDescription.InDefinedShape>
getRecordComponents()
Returns the list of record components that are declared by this type.TypeDescription.Generic
getSuperClass()
Returns the super class of this type.TypeList.Generic
getTypeVariables()
Returns the type variables that are declared by this element.boolean
isAnonymousType()
Checks if this type description represents an anonymous type.boolean
isLocalType()
Checks if this type description represents a local type.boolean
isRecord()
Checks if this type is a Java record.-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.AbstractBase.OfSimpleType
getCanonicalName, getComponentType, getDescriptor, getSimpleName, getStackSize, isArray, isPrimitive
-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.AbstractBase
accept, asBoxed, asErasure, asGenericType, asUnboxed, equals, getActualModifiers, getActualName, getDefaultValue, getEnclosingSource, getGenericSignature, getInheritedAnnotations, getInnerClassCount, getInternalName, getSort, getTypeName, hashCode, isAccessibleTo, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isCompileTimeConstant, isGenerified, isInferrable, isInHierarchyWith, isInHierarchyWith, isInnerClass, isInstance, isMemberType, isNestedClass, isNestHost, isNestMateOf, isNestMateOf, isPackageType, isPrimitiveWrapper, isSamePackage, isSealed, isVisibleTo, iterator, represents, toString
-
Methods inherited from class net.bytebuddy.description.TypeVariableSource.AbstractBase
findVariable
-
Methods inherited from class net.bytebuddy.description.ModifierReviewable.AbstractBase
getEnumerationState, getFieldManifestation, getFieldPersistence, getMethodManifestation, getMethodStrictness, getOwnership, getParameterManifestation, getProvisioningState, getSynchronizationState, getSyntheticState, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatile
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getSyntheticState, isFinal, isSynthetic
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.ForTypeDefinition
getTypeManifestation, isAnnotation, isInterface
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfAbstraction
isAbstract
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfEnumeration
getEnumerationState, isEnum
-
Methods inherited from interface net.bytebuddy.description.TypeVariableSource
findVariable
-
-
-
-
Field Detail
-
name
private final java.lang.String name
The name of the type.
-
modifiers
private final int modifiers
The modifiers of the type.
-
superClass
private final TypeDescription.Generic superClass
The super type ornull
if no such type exists.
-
interfaces
private final java.util.List<? extends TypeDescription.Generic> interfaces
The interfaces that this type implements.
-
-
Constructor Detail
-
Latent
public Latent(java.lang.String name, int modifiers, TypeDescription.Generic superClass, TypeDescription.Generic... anInterface)
Creates a new latent type.- Parameters:
name
- The name of the type.modifiers
- The modifiers of the type.superClass
- The super type ornull
if no such type exists.anInterface
- The interfaces that this type implements.
-
Latent
public Latent(java.lang.String name, int modifiers, TypeDescription.Generic superClass, java.util.List<? extends TypeDescription.Generic> interfaces)
Creates a new latent type.- Parameters:
name
- The name of the type.modifiers
- The modifiers of the type.superClass
- The super type ornull
if no such type exists.interfaces
- The interfaces that this type implements.
-
-
Method Detail
-
getSuperClass
public TypeDescription.Generic getSuperClass()
Returns the super class of this type. A super type is only defined for non-generic types (TypeDefinition.Sort.NON_GENERIC
), parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Interface types and theObject
class do not define a super class wherenull
is returned. Array types defineObject
as their direct super class.- Returns:
- The super class of this type or
null
if no super class exists for this type.
-
getInterfaces
public TypeList.Generic getInterfaces()
Returns the interfaces that this type implements. A super type is only defined for non-generic types (TypeDefinition.Sort.NON_GENERIC
), parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types.- Returns:
- The interfaces that this type implements.
-
getEnclosingMethod
public MethodDescription.InDefinedShape getEnclosingMethod()
Returns a description of the method that encloses this type. If this method is not enclosed by any type or is enclosed by the type initializer,null
is returned by this method.- Returns:
- A description of the enclosing method of this type or
null
if there is no such method.
-
getEnclosingType
public TypeDescription getEnclosingType()
Returns a description of this type's enclosing type if any.- Returns:
- A description of the enclosing type of this type or
null
if there is no such type.
-
getDeclaredTypes
public TypeList getDeclaredTypes()
Returns a list of types that are declared by this type. This list does not normally include anonymous types but might include additional types if they are explicitly added to an instrumented type.- Returns:
- A list of types that are declared within this type.
-
isAnonymousType
public boolean isAnonymousType()
Checks if this type description represents an anonymous type.- Returns:
true
if this type description represents an anonymous type.
-
isLocalType
public boolean isLocalType()
Checks if this type description represents a local type.- Returns:
true
if this type description represents a local type.
-
getDeclaredFields
public FieldList<FieldDescription.InDefinedShape> getDeclaredFields()
Returns the fields that this type declares. A super type is only defined for non-generic types (TypeDefinition.Sort.NON_GENERIC
), parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Generic array types never define fields and the returned list is always empty for such types.- Returns:
- The fields that this type declares. A super type is only defined for non-generic types (
TypeDefinition.Sort.NON_GENERIC
), parameterized types (TypeDefinition.Sort.PARAMETERIZED
) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY
) types. Generic array types never define methods and the returned list is always empty for such types.
-
getDeclaredMethods
public MethodList<MethodDescription.InDefinedShape> getDeclaredMethods()
Returns the methods that this type declares.- Returns:
- The methods that this type declares.
-
getPackage
public PackageDescription getPackage()
Returns the package of the type described by this instance ornull
if the described type does not imply a package.- Returns:
- The package of the type described by this instance or
null
if the described type does not imply a package.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
getDeclaringType
public TypeDescription getDeclaringType()
Returns the declaring type of this instance.- Returns:
- The declaring type or
null
if no such type exists.
-
getModifiers
public int getModifiers()
Returns the modifier that is described by this object.- Returns:
- The modifier that is described by this object.
-
getName
public java.lang.String getName()
Returns the internalName of this byte code element.- Returns:
- The internalName of this byte code element as visible from within a running Java application.
-
getTypeVariables
public TypeList.Generic getTypeVariables()
Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getNestHost
public TypeDescription getNestHost()
Returns the nest host of this type. For types prior to Java 11, this type is returned which is the default nest host.- Returns:
- The nest host of this type.
-
getNestMembers
public TypeList getNestMembers()
Returns a list of members that are part of a nesting group. Prior to Java 11, a list that only contains this type is returned which is the default nest group.- Returns:
- A list of members of this nest group.
-
getRecordComponents
public RecordComponentList<RecordComponentDescription.InDefinedShape> getRecordComponents()
Returns the list of record components that are declared by this type. If this type is not a record, the returned list is empty.- Returns:
- A list of record components that this type declares.
-
isRecord
public boolean isRecord()
Checks if this type is a Java record.- Returns:
true
if this type is a Java record.
-
getPermittedSubclasses
public TypeList getPermittedSubclasses()
Returns the list of permitted subclasses if this class is a sealed class or an empty list if this class is not sealed.- Returns:
- The list of permitted subclasses if this class is a sealed class or an empty list if this class is not sealed.
-
-