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:
Iterable<TypeDefinition>, AnnotationSource, ByteCodeElement, DeclaredByType, ModifierReviewable, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatable, NamedElement, NamedElement.WithDescriptor, NamedElement.WithRuntimeName, TypeDefinition, TypeDescription, TypeVariableSource
- Direct Known Subclasses:
JavaType.LatentTypeWithSimpleName
- Enclosing interface:
TypeDescription
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 TypeDescription.AbstractBase.OfSimpleType
TypeDescription.AbstractBase.OfSimpleType.WithDelegationNested classes/interfaces inherited from class TypeDescription.AbstractBase
TypeDescription.AbstractBase.OfSimpleTypeNested classes/interfaces inherited from interface AnnotationSource
AnnotationSource.Empty, AnnotationSource.ExplicitNested classes/interfaces inherited from interface ByteCodeElement
ByteCodeElement.Member, ByteCodeElement.Token<T>, ByteCodeElement.TypeDependant<T,S> Nested classes/interfaces inherited from interface DeclaredByType
DeclaredByType.WithMandatoryDeclarationNested classes/interfaces inherited from interface ModifierReviewable
ModifierReviewable.AbstractBase, ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForModuleDescription, ModifierReviewable.ForModuleRequirement, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration, ModifierReviewable.OfMandatableNested classes/interfaces inherited from interface NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameNested classes/interfaces inherited from interface TypeDefinition
TypeDefinition.Sort, TypeDefinition.SuperClassIteratorNested classes/interfaces inherited from interface TypeDescription
TypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.Generic, TypeDescription.Latent, TypeDescription.LazyProxy, TypeDescription.SuperTypeLoadingNested classes/interfaces inherited from interface TypeVariableSource
TypeVariableSource.AbstractBase, TypeVariableSource.Visitor<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<? extends TypeDescription.Generic> The interfaces that this type implements.private final intThe modifiers of the type.private final StringThe name of the type.private final TypeDescription.GenericThe super type ornullif no such type exists.Fields inherited from class TypeDescription.AbstractBase
RAW_TYPESFields inherited from interface ModifierReviewable
EMPTY_MASKFields inherited from interface NamedElement
EMPTY_NAME, NO_NAMEFields inherited from interface NamedElement.WithDescriptor
NON_GENERIC_SIGNATUREFields inherited from interface TypeDefinition
RAW_TYPES_PROPERTYFields inherited from interface TypeDescription
ARRAY_INTERFACES, CLASS, OBJECT, STRING, THROWABLE, UNDEFINED, VOIDFields inherited from interface TypeVariableSource
UNDEFINED -
Constructor Summary
ConstructorsConstructorDescriptionLatent(String name, int modifiers, TypeDescription.Generic superClass, List<? extends TypeDescription.Generic> interfaces) Creates a new latent type.Latent(String name, int modifiers, TypeDescription.Generic superClass, TypeDescription.Generic... anInterface) Creates a new latent type. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of annotations that are declared by this instance.Returns the fields that this type declares.Returns the methods that this type declares.Returns a list of types that are declared by this type.Returns the declaring type of this instance.Returns a description of the method that encloses this type.Returns a description of this type's enclosing type if any.Returns the interfaces that this type implements.intReturns the modifier that is described by this object.getName()Returns the binary name of this byte code element.Returns the nest host of this type.Returns a list of members that are part of a nesting group.Returns the package of the type described by this instance ornullif the described type is a primitive type or an array.Returns the list of permitted direct subclasses if this class is a sealed class.Returns the list of record components that are declared by this type.Returns the super class of this type.Returns the type variables that are declared by this element.booleanChecks if this type description represents an anonymous type.booleanChecks if this type description represents a local type.booleanisRecord()Checks if this type is a Java record.Returns a representation of a Java module that is represented by this type description, normally amodule-info.classfile.Methods inherited from class TypeDescription.AbstractBase.OfSimpleType
getCanonicalName, getComponentType, getDescriptor, getSimpleName, getStackSize, isArray, isPrimitiveMethods inherited from class TypeDescription.AbstractBase
accept, asBoxed, asErasure, asGenericType, asUnboxed, equals, getActualModifiers, getActualName, getClassFileVersion, getDefaultValue, getEnclosingSource, getGenericSignature, getInheritedAnnotations, getInnerClassCount, getInternalName, getLongSimpleName, getSort, getTypeName, hashCode, isAccessibleTo, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isCompileTimeConstant, isGenerified, isInferrable, isInHierarchyWith, isInHierarchyWith, isInnerClass, isInstance, isMemberType, isModuleType, isNestedClass, isNestHost, isNestMateOf, isNestMateOf, isPackageType, isPrimitiveWrapper, isSamePackage, isSealed, isVisibleTo, iterator, represents, toSafeString, toStringMethods inherited from class TypeVariableSource.AbstractBase
findExpectedVariable, findVariableMethods inherited from class ModifierReviewable.AbstractBase
getEnumerationState, getFieldManifestation, getFieldPersistence, getMandate, getMethodManifestation, getMethodStrictness, getOpenness, getOwnership, getParameterManifestation, getProvisioningState, getRequiredPhase, getSynchronizationState, getSyntheticState, getTransitivity, getTypeManifestation, getVisibility, isAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isOpen, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStaticPhase, isStrict, isSynchronized, isSynthetic, isTransient, isTransitive, isVarArgs, isVolatileMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface ModifierReviewable
getSyntheticState, isFinal, isSyntheticMethods inherited from interface ModifierReviewable.ForTypeDefinition
getTypeManifestation, isAnnotation, isInterfaceMethods inherited from interface ModifierReviewable.OfAbstraction
isAbstractMethods inherited from interface ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticMethods inherited from interface ModifierReviewable.OfEnumeration
getEnumerationState, isEnumMethods inherited from interface TypeVariableSource
findExpectedVariable, findVariable
-
Field Details
-
name
The name of the type. -
modifiers
private final int modifiersThe modifiers of the type. -
superClass
The super type ornullif no such type exists. -
interfaces
The interfaces that this type implements.
-
-
Constructor Details
-
Latent
public Latent(String name, int modifiers, @MaybeNull 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 ornullif no such type exists.anInterface- The interfaces that this type implements.
-
Latent
public Latent(String name, int modifiers, @MaybeNull TypeDescription.Generic superClass, 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 ornullif no such type exists.interfaces- The interfaces that this type implements.
-
-
Method Details
-
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 theObjectclass do not define a super class wherenullis returned. Array types defineObjectas their direct super class.- Returns:
- The super class of this type or
nullif no super class exists for this type.
-
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
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,nullis returned by this method.- Returns:
- A description of the enclosing method of this type or
nullif there is no such method.
-
getEnclosingType
Returns a description of this type's enclosing type if any.- Returns:
- A description of the enclosing type of this type or
nullif there is no such type.
-
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:
trueif this type description represents an anonymous type.
-
isLocalType
public boolean isLocalType()Checks if this type description represents a local type.- Returns:
trueif this type description represents a local type.
-
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
Returns the methods that this type declares.- Returns:
- The methods that this type declares.
-
getPackage
Returns the package of the type described by this instance ornullif the described type is a primitive type or an array.- Returns:
- The package of the type described by this instance or
nullif the described type is a primitive type or an array.
-
toModuleDescription
Returns a representation of a Java module that is represented by this type description, normally amodule-info.classfile. If there is no module meta-data attached to the current class,nullis returned.- Returns:
- A description of the module information of this type or
nullif no such information is available.
-
getDeclaredAnnotations
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
getDeclaringType
Returns the declaring type of this instance.- Returns:
- The declaring type or
nullif 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
Returns the binary name of this byte code element. If no well-defined internal name is known for this element, the actual name is returned.- Returns:
- The binary ame of this byte code element as visible from within a running Java application.
-
getTypeVariables
Returns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
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
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
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:
trueif this type is a Java record.
-
getPermittedSubtypes
Returns the list of permitted direct subclasses if this class is a sealed class. Permitted subclasses might or might not be resolvable, where unresolvable subclasses might also be missing from the list. For returned types, methods that return the class's name will always be invokable without errors. If this type is not sealed, an empty list is returned. Note that an empty list might also be returned for a sealed type, if no type permitted subtype is resolvable.- Returns:
- The list of permitted subtypes or an empty list if this type is not sealed.
-