Package net.bytebuddy.pool
Class TypePool.Default.LazyTypeDescription.TokenizedGenericType
- java.lang.Object
-
- net.bytebuddy.description.ModifierReviewable.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.Generic.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.Generic.LazyProjection
-
- net.bytebuddy.description.type.TypeDescription.Generic.LazyProjection.WithEagerNavigation
-
- net.bytebuddy.pool.TypePool.Default.LazyTypeDescription.TokenizedGenericType
-
- All Implemented Interfaces:
java.lang.Iterable<TypeDefinition>
,AnnotationSource
,ModifierReviewable
,ModifierReviewable.ForFieldDescription
,ModifierReviewable.ForMethodDescription
,ModifierReviewable.ForParameterDescription
,ModifierReviewable.ForTypeDefinition
,ModifierReviewable.OfAbstraction
,ModifierReviewable.OfByteCodeElement
,ModifierReviewable.OfEnumeration
,NamedElement
,TypeDefinition
,TypeDescription.Generic
- Enclosing class:
- TypePool.Default.LazyTypeDescription
protected static class TypePool.Default.LazyTypeDescription.TokenizedGenericType extends TypeDescription.Generic.LazyProjection.WithEagerNavigation
A representation of a generic type that is described by aTypePool.Default.LazyTypeDescription.GenericTypeToken
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TypePool.Default.LazyTypeDescription.TokenizedGenericType.Malformed
A lazy description of a non-well-defined described generic type.protected static class
TypePool.Default.LazyTypeDescription.TokenizedGenericType.TokenList
A tokenized list of generic types.protected static class
TypePool.Default.LazyTypeDescription.TokenizedGenericType.TypeVariableList
A list of tokenized type variables.-
Nested classes/interfaces inherited from class net.bytebuddy.description.type.TypeDescription.Generic.LazyProjection.WithEagerNavigation
TypeDescription.Generic.LazyProjection.WithEagerNavigation.OfAnnotatedElement
-
Nested classes/interfaces inherited from class net.bytebuddy.description.type.TypeDescription.Generic.LazyProjection
TypeDescription.Generic.LazyProjection.ForLoadedFieldType, TypeDescription.Generic.LazyProjection.ForLoadedReturnType, TypeDescription.Generic.LazyProjection.ForLoadedSuperClass, TypeDescription.Generic.LazyProjection.OfConstructorParameter, TypeDescription.Generic.LazyProjection.OfMethodParameter, TypeDescription.Generic.LazyProjection.OfRecordComponent, TypeDescription.Generic.LazyProjection.WithEagerNavigation, TypeDescription.Generic.LazyProjection.WithLazyNavigation, TypeDescription.Generic.LazyProjection.WithResolvedErasure
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.Explicit
-
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.Generic
TypeDescription.Generic.AbstractBase, TypeDescription.Generic.AnnotationReader, TypeDescription.Generic.Builder, TypeDescription.Generic.LazyProjection, TypeDescription.Generic.OfGenericArray, TypeDescription.Generic.OfNonGenericType, TypeDescription.Generic.OfParameterizedType, TypeDescription.Generic.OfTypeVariable, TypeDescription.Generic.OfWildcardType, TypeDescription.Generic.Visitor<T>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>>
annotationTokens
The tokenized type's type annotation tokens.private TypePool.Default.LazyTypeDescription.GenericTypeToken
genericTypeToken
The token that describes the represented generic type.private java.lang.String
rawTypeDescriptor
A descriptor of the generic type's raw type.private TypePool
typePool
The type pool to use for locating referenced types.private TypeVariableSource
typeVariableSource
The closest type variable source of this generic type's declaration context.-
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.Generic
ANNOTATION, CLASS, OBJECT, UNDEFINED, VOID
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TokenizedGenericType(TypePool typePool, TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken, java.lang.String rawTypeDescriptor, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens, TypeVariableSource typeVariableSource)
Creates a new tokenized generic type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeDescription
asErasure()
Returns the erasure of this type.AnnotationList
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.protected static TypeDescription.Generic
of(TypePool typePool, TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken, java.lang.String rawTypeDescriptor, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens, TypeVariableSource typeVariableSource)
Creates a new generic type description for a tokenized generic type.protected TypeDescription.Generic
resolve()
Resolves the actual generic type.protected static TypeDescription
toErasure(TypePool typePool, java.lang.String descriptor)
Creates a type description from a descriptor by looking up the corresponding type.-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.LazyProjection.WithEagerNavigation
getInterfaces, getSuperClass, iterator
-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.LazyProjection
accept, equals, findBindingOf, getActualName, getComponentType, getDeclaredFields, getDeclaredMethods, getLowerBounds, getOwnerType, getRecordComponents, getSort, getStackSize, getSymbol, getTypeArguments, getTypeName, getTypeVariableSource, getUpperBounds, hashCode, isArray, isPrimitive, isRecord, represents, toString
-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.AbstractBase
asGenericType, asRawType, getModifiers
-
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
-
-
-
-
Field Detail
-
typePool
private final TypePool typePool
The type pool to use for locating referenced types.
-
genericTypeToken
private final TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken
The token that describes the represented generic type.
-
rawTypeDescriptor
private final java.lang.String rawTypeDescriptor
A descriptor of the generic type's raw type.
-
annotationTokens
private final java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens
The tokenized type's type annotation tokens.
-
typeVariableSource
private final TypeVariableSource typeVariableSource
The closest type variable source of this generic type's declaration context.
-
-
Constructor Detail
-
TokenizedGenericType
protected TokenizedGenericType(TypePool typePool, TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken, java.lang.String rawTypeDescriptor, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens, TypeVariableSource typeVariableSource)
Creates a new tokenized generic type.- Parameters:
typePool
- The type pool to use for locating referenced types.genericTypeToken
- The token that describes the represented generic type.rawTypeDescriptor
- A descriptor of the generic type's erasure.annotationTokens
- The tokenized type's type annotation tokens.typeVariableSource
- The closest type variable source of this generic type's declaration context.
-
-
Method Detail
-
of
protected static TypeDescription.Generic of(TypePool typePool, TypePool.Default.LazyTypeDescription.GenericTypeToken genericTypeToken, java.lang.String rawTypeDescriptor, java.util.Map<java.lang.String,java.util.List<TypePool.Default.LazyTypeDescription.AnnotationToken>> annotationTokens, TypeVariableSource typeVariableSource)
Creates a new generic type description for a tokenized generic type.- Parameters:
typePool
- The type pool to use for locating referenced types.genericTypeToken
- The token that describes the represented generic type.rawTypeDescriptor
- A descriptor of the generic type's erasure.annotationTokens
- The tokenized type's type annotation tokens ornull
if no such annotations are defined.typeVariableSource
- The closest type variable source of this generic type's declaration context.- Returns:
- A suitable generic type.
-
toErasure
protected static TypeDescription toErasure(TypePool typePool, java.lang.String descriptor)
Creates a type description from a descriptor by looking up the corresponding type.- Parameters:
typePool
- The type pool to use for locating a type.descriptor
- The descriptor to interpret.- Returns:
- A description of the type represented by the descriptor.
-
resolve
@Enhance("resolved") protected TypeDescription.Generic resolve()
Description copied from class:TypeDescription.Generic.LazyProjection
Resolves the actual generic type.- Specified by:
resolve
in classTypeDescription.Generic.LazyProjection
- Returns:
- An actual description of the represented generic type.
-
asErasure
@Enhance("erasure") public TypeDescription asErasure()
Returns the erasure of this type. Wildcard types (TypeDefinition.Sort.WILDCARD
) do not have a well-defined erasure and cause anIllegalStateException
to be thrown.- Returns:
- The erasure of this type.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.- Returns:
- A list of declared annotations.
-
-