Package net.bytebuddy.pool
Class TypePool.Default.LazyTypeDescription
- 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.pool.TypePool.Default.LazyTypeDescription
-
- 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.WithRuntimeName,TypeDefinition,TypeDescription,TypeVariableSource
- Enclosing class:
- TypePool.Default
protected static class TypePool.Default.LazyTypeDescription extends TypeDescription.AbstractBase.OfSimpleType
A type description that looks up any referencedByteCodeElementorAnnotationDescriptionby querying a type pool at lookup time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classTypePool.Default.LazyTypeDescription.AnnotationTokenA token for representing collected data on an annotation.protected static classTypePool.Default.LazyTypeDescription.FieldTokenA token for representing collected data on a field.protected classTypePool.Default.LazyTypeDescription.FieldTokenListA list of field tokens representing each entry as a field description.protected static interfaceTypePool.Default.LazyTypeDescription.GenericTypeTokenA token that represents a generic Java type.protected static classTypePool.Default.LazyTypeDescription.MethodTokenA token for representing collected data on a method.protected classTypePool.Default.LazyTypeDescription.MethodTokenListA list of method tokens representing each entry as a method description.protected static interfaceTypePool.Default.LazyTypeDescription.TypeContainmentA declaration context encapsulates information about whether a type was declared within another type or within a method of another type.-
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.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 inherited from class net.bytebuddy.description.type.TypeDescription.AbstractBase
RAW_TYPES
-
Fields inherited from interface net.bytebuddy.description.ByteCodeElement
NON_GENERIC_SIGNATURE
-
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.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 Modifier Constructor Description protectedLazyTypeDescription(TypePool typePool, int actualModifiers, int modifiers, java.lang.String name, java.lang.String superClassInternalName, java.lang.String[] interfaceInternalName, java.lang.String genericSignature, TypePool.Default.LazyTypeDescription.TypeContainment typeContainment, java.lang.String declaringTypeInternalName, java.util.List<java.lang.String> declaredTypes, boolean anonymousType, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> superTypeAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundsAnnotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.FieldToken> fieldTokens, java.util.List<TypePool.Default.LazyTypeDescription.MethodToken> methodTokens)Creates a new lazy type description.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetActualModifiers(boolean superFlag)Returns the type's actual modifiers as present in the class file.AnnotationListgetDeclaredAnnotations()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.TypeListgetDeclaredTypes()Returns a list of types that are declared by this type excluding anonymous classes.TypeDescriptiongetDeclaringType()Returns the declaring type of this instance.MethodDescriptiongetEnclosingMethod()Returns a description of the method that encloses this type.TypeDescriptiongetEnclosingType()Returns a description of this type's enclosing type if any.java.lang.StringgetGenericSignature()Returns the generic signature of this byte code element.TypeList.GenericgetInterfaces()Returns the interfaces that this type implements.intgetModifiers()Returns the modifier that is described by this object.java.lang.StringgetName()Returns the internalName of this byte code element.PackageDescriptiongetPackage()Returns the package internalName of the type described by this instance.TypeDescription.GenericgetSuperClass()Returns the super class of this type.TypeList.GenericgetTypeVariables()Returns the type variables that are declared by this element.booleanisAnonymousClass()Checks if this type description represents an anonymous type.booleanisLocalClass()Checks if this type description represents a local type.booleanisMemberClass()Checks if this type description represents a member type.-
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, getActualName, getDefaultValue, getEnclosingSource, getInheritedAnnotations, getInnerClassCount, getInternalName, getSort, getTypeName, hashCode, isAccessibleTo, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isGenerified, isInnerClass, isInstance, isNestedClass, isPackageType, isPrimitiveWrapper, isSamePackage, 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
-
-
-
-
Constructor Detail
-
LazyTypeDescription
protected LazyTypeDescription(TypePool typePool, int actualModifiers, int modifiers, java.lang.String name, java.lang.String superClassInternalName, java.lang.String[] interfaceInternalName, java.lang.String genericSignature, TypePool.Default.LazyTypeDescription.TypeContainment typeContainment, java.lang.String declaringTypeInternalName, java.util.List<java.lang.String> declaredTypes, boolean anonymousType, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> superTypeAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>> typeVariableAnnotationTokens, java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>>> typeVariableBoundsAnnotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken> annotationTokens, java.util.List<TypePool.Default.LazyTypeDescription.FieldToken> fieldTokens, java.util.List<TypePool.Default.LazyTypeDescription.MethodToken> methodTokens)
Creates a new lazy type description.- Parameters:
typePool- The type pool to be used for looking up linked types.actualModifiers- The actual modifiers of this type.modifiers- The modifiers of this type.name- The binary name of this type.superClassInternalName- The internal name of this type's super type ornullif no such super type is defined.interfaceInternalName- An array of this type's interfaces ornullif this type does not define any interfaces.genericSignature- The type's generic signature as found in the class file ornullif the type is not generic.typeContainment- A definition of this type's containment within another type or method.declaringTypeInternalName- The internal name of this type's declaring type ornullif no such type exists.declaredTypes- A list of descriptors representing the types that are declared by this type.anonymousType-trueif this type is an anonymous type.superTypeAnnotationTokens- A mapping of type annotations for this type's super type and interface types by their indices.typeVariableAnnotationTokens- A mapping of type annotations of the type variables' type annotations by their indices.typeVariableBoundsAnnotationTokens- A mapping of type annotations of the type variables' bounds' type annotations by their indices and each variable's index.annotationTokens- A list of tokens that represent the annotations of this type.fieldTokens- A list of field tokens describing the field's of this type.methodTokens- A list of method tokens describing the method's of this type.
-
-
Method Detail
-
getSuperClass
public TypeDescription.Generic getSuperClass()
Description copied from interface:TypeDefinitionReturns 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
public TypeList.Generic getInterfaces()
Description copied from interface:TypeDefinitionReturns 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 getEnclosingMethod()
Description copied from interface:TypeDescriptionReturns 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
public TypeDescription getEnclosingType()
Description copied from interface:TypeDescriptionReturns 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
public TypeList getDeclaredTypes()
Description copied from interface:TypeDescriptionReturns a list of types that are declared by this type excluding anonymous classes.- Returns:
- A list of types that are declared within this type.
-
isAnonymousClass
public boolean isAnonymousClass()
Description copied from interface:TypeDescriptionChecks if this type description represents an anonymous type.- Returns:
trueif this type description represents an anonymous type.
-
isLocalClass
public boolean isLocalClass()
Description copied from interface:TypeDescriptionChecks if this type description represents a local type.- Returns:
trueif this type description represents a local type.
-
isMemberClass
public boolean isMemberClass()
Description copied from interface:TypeDescriptionChecks if this type description represents a member type.- Returns:
trueif this type description represents a member type.
-
getDeclaredFields
public FieldList<FieldDescription.InDefinedShape> getDeclaredFields()
Description copied from interface:TypeDefinitionReturns 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()
Description copied from interface:TypeDefinitionReturns the methods that this type declares.- Returns:
- The methods that this type declares.
-
getPackage
public PackageDescription getPackage()
Description copied from interface:TypeDescriptionReturns the package internalName of the type described by this instance.- Returns:
- The package internalName of the type described by this instance.
-
getName
public java.lang.String getName()
Description copied from interface:NamedElement.WithRuntimeNameReturns the internalName of this byte code element.- Returns:
- The internalName of this byte code element as visible from within a running Java application.
-
getDeclaringType
public TypeDescription getDeclaringType()
Description copied from interface:DeclaredByTypeReturns the declaring type of this instance.- Returns:
- The declaring type or
nullif no such type exists.
-
getModifiers
public int getModifiers()
Description copied from interface:ModifierReviewableReturns the modifier that is described by this object.- Returns:
- The modifier that is described by this object.
-
getActualModifiers
public int getActualModifiers(boolean superFlag)
Description copied from interface:TypeDescriptionReturns the type's actual modifiers as present in the class file. For example, a type cannot beprivate. but it modifiers might reflect this property nevertheless if a class was defined as a private inner class. The returned modifiers take also into account if the type is marked asDeprecated. Anonymous classes that are enclosed in a static method or the type initializer are additionally marked asfinalas it is also done by the Java compiler.- Specified by:
getActualModifiersin interfaceTypeDescription- Overrides:
getActualModifiersin classTypeDescription.AbstractBase- Parameters:
superFlag-trueif the modifier's super flag should be set.- Returns:
- The type's actual modifiers.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Description copied from interface:AnnotationSourceReturns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
getTypeVariables
public TypeList.Generic getTypeVariables()
Description copied from interface:TypeVariableSourceReturns the type variables that are declared by this element.- Returns:
- The type variables that are declared by this element.
-
getGenericSignature
public java.lang.String getGenericSignature()
Description copied from interface:ByteCodeElementReturns the generic signature of this byte code element. If this element does not reference generic types or references malformed generic types,nullis returned as a signature.- Specified by:
getGenericSignaturein interfaceByteCodeElement- Overrides:
getGenericSignaturein classTypeDescription.AbstractBase- Returns:
- The generic signature or
nullif this element is not generic.
-
-