Package net.bytebuddy.description.type
Class TypeDescription.Generic.OfParameterizedType.ForReifiedType
- java.lang.Object
-
- net.bytebuddy.description.ModifierReviewable.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.Generic.AbstractBase
-
- net.bytebuddy.description.type.TypeDescription.Generic.OfParameterizedType
-
- net.bytebuddy.description.type.TypeDescription.Generic.OfParameterizedType.ForReifiedType
-
- 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:
- TypeDescription.Generic.OfParameterizedType
public static class TypeDescription.Generic.OfParameterizedType.ForReifiedType extends TypeDescription.Generic.OfParameterizedType
A representation of a parameterized type that is a super type of a raw type but preserves the minimal type information that is required for allowing creating correct erasures for overridden methods. All members' types are erased and all type arguments are reduced to their erasure.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.bytebuddy.description.type.TypeDescription.Generic.OfParameterizedType
TypeDescription.Generic.OfParameterizedType.ForGenerifiedErasure, TypeDescription.Generic.OfParameterizedType.ForLoadedType, TypeDescription.Generic.OfParameterizedType.ForReifiedType, TypeDescription.Generic.OfParameterizedType.Latent, TypeDescription.Generic.OfParameterizedType.RenderingDelegate
-
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 TypeDescription.Generic
parameterizedType
The represented parameterized type.-
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
ForReifiedType(TypeDescription.Generic parameterizedType)
Creates a new reified parameterized type.
-
Method Summary
All 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.FieldList<FieldDescription.InGenericShape>
getDeclaredFields()
Returns the fields that this type declares.MethodList<MethodDescription.InGenericShape>
getDeclaredMethods()
Returns the methods that this type declares.TypeList.Generic
getInterfaces()
Returns the interfaces that this type implements.TypeDescription.Generic
getOwnerType()
Returns the owner type of this type.TypeDescription.Generic
getSuperClass()
Returns the super class of this type.TypeList.Generic
getTypeArguments()
Returns the type arguments of this type.-
Methods inherited from class net.bytebuddy.description.type.TypeDescription.Generic.OfParameterizedType
accept, equals, findBindingOf, getActualName, getComponentType, getLowerBounds, getRecordComponents, getSort, getStackSize, getSymbol, getTypeName, getTypeVariableSource, getUpperBounds, hashCode, isArray, isPrimitive, isRecord, iterator, 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
-
parameterizedType
private final TypeDescription.Generic parameterizedType
The represented parameterized type.
-
-
Constructor Detail
-
ForReifiedType
protected ForReifiedType(TypeDescription.Generic parameterizedType)
Creates a new reified parameterized type.- Parameters:
parameterizedType
- The represented parameterized type.
-
-
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.- Specified by:
getSuperClass
in interfaceTypeDefinition
- Overrides:
getSuperClass
in classTypeDescription.Generic.OfParameterizedType
- 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.- Specified by:
getInterfaces
in interfaceTypeDefinition
- Overrides:
getInterfaces
in classTypeDescription.Generic.OfParameterizedType
- Returns:
- The interfaces that this type implements.
-
getDeclaredFields
public FieldList<FieldDescription.InGenericShape> 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.- Specified by:
getDeclaredFields
in interfaceTypeDefinition
- Specified by:
getDeclaredFields
in interfaceTypeDescription.Generic
- Overrides:
getDeclaredFields
in classTypeDescription.Generic.OfParameterizedType
- 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.InGenericShape> getDeclaredMethods()
Returns the methods that this type declares.- Specified by:
getDeclaredMethods
in interfaceTypeDefinition
- Specified by:
getDeclaredMethods
in interfaceTypeDescription.Generic
- Overrides:
getDeclaredMethods
in classTypeDescription.Generic.OfParameterizedType
- Returns:
- The methods that this type declares.
-
getTypeArguments
public TypeList.Generic getTypeArguments()
Returns the type arguments of this type.
Parameters are only well-defined for parameterized types (
TypeDefinition.Sort.PARAMETERIZED
). For all other types, this method throws anIllegalStateException
.- Returns:
- A list of this type's type parameters.
-
getOwnerType
public TypeDescription.Generic getOwnerType()
Returns the owner type of this type. A type's owner type describes a nested type's declaring type. If it exists, the returned type can be a non-generic or parameterized type. If a class has no declaring type,
null
is returned.An owner type is only well-defined for parameterized types (
TypeDefinition.Sort.PARAMETERIZED
), for non-generic types (TypeDefinition.Sort.NON_GENERIC
) and for generic arrays (TypeDefinition.Sort.GENERIC_ARRAY
). For all other types, this method throws anIllegalStateException
.- Returns:
- This type's owner type or
null
if no owner type exists.
-
asErasure
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.
-
-