Package net.bytebuddy.dynamic.scaffold
Class InstrumentedType.Default
- 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.dynamic.scaffold.InstrumentedType.Default
-
- 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
,InstrumentedType
,InstrumentedType.WithFlexibleName
- Enclosing interface:
- InstrumentedType
public static class InstrumentedType.Default extends TypeDescription.AbstractBase.OfSimpleType implements InstrumentedType.WithFlexibleName
A default implementation of an instrumented type.
-
-
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.dynamic.scaffold.InstrumentedType
InstrumentedType.Default, InstrumentedType.Factory, InstrumentedType.Frozen, InstrumentedType.Prepareable, InstrumentedType.WithFlexibleName
-
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 protected
Default(java.lang.String name, int modifiers, TypeDescription.Generic superClass, java.util.List<? extends TypeVariableToken> typeVariables, java.util.List<? extends TypeDescription.Generic> interfaceTypes, java.util.List<? extends FieldDescription.Token> fieldTokens, java.util.List<? extends MethodDescription.Token> methodTokens, java.util.List<? extends AnnotationDescription> annotationDescriptions, TypeInitializer typeInitializer, LoadedTypeInitializer loadedTypeInitializer, TypeDescription declaringType, MethodDescription enclosingMethod, TypeDescription enclosingType, java.util.List<? extends TypeDescription> declaredTypes, boolean memberClass, boolean anonymousClass, boolean localClass)
Creates a new instrumented type.
-
Method Summary
All Methods Static 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 excluding anonymous classes.TypeDescription
getDeclaringType()
Returns the declaring type of this instance.MethodDescription
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.LoadedTypeInitializer
getLoadedTypeInitializer()
Returns theLoadedTypeInitializer
s that were registered for this instrumented type.int
getModifiers()
Returns the modifier that is described by this object.java.lang.String
getName()
Returns the internalName of this byte code element.PackageDescription
getPackage()
Returns the package internalName of the type described by this instance.TypeDescription.Generic
getSuperClass()
Returns the super class of this type.TypeInitializer
getTypeInitializer()
Returns this instrumented type's type initializer.TypeList.Generic
getTypeVariables()
Returns the type variables that are declared by this element.boolean
isAnonymousClass()
Checks if this type description represents an anonymous type.boolean
isLocalClass()
Checks if this type description represents a local type.boolean
isMemberClass()
Checks if this type description represents a member type.static InstrumentedType
of(java.lang.String name, TypeDescription.Generic superClass, int modifiers)
Creates a new instrumented type.static InstrumentedType
of(java.lang.String name, TypeDescription.Generic superClass, ModifierContributor.ForType... modifierContributor)
Creates a new instrumented type.TypeDescription
validated()
Validates the instrumented type to define a legal Java type.InstrumentedType.WithFlexibleName
withAnnotations(java.util.List<? extends AnnotationDescription> annotationDescriptions)
Creates a new instrumented type with the given annotations.InstrumentedType.WithFlexibleName
withField(FieldDescription.Token token)
Creates a new instrumented type that includes a new field.InstrumentedType.WithFlexibleName
withInitializer(ByteCodeAppender byteCodeAppender)
Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.InstrumentedType.WithFlexibleName
withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the givenLoadedTypeInitializer
.InstrumentedType.WithFlexibleName
withInterfaces(TypeList.Generic interfaceTypes)
Creates a new instrumented type with the given interfaces implemented.InstrumentedType.WithFlexibleName
withMethod(MethodDescription.Token token)
Creates a new instrumented type that includes a new method or constructor.InstrumentedType.WithFlexibleName
withModifiers(int modifiers)
Creates a new instrumented type with changed modifiers.InstrumentedType.WithFlexibleName
withName(java.lang.String name)
Creates a new instrumented type with a changed name.InstrumentedType.WithFlexibleName
withTypeVariable(TypeVariableToken typeVariable)
Creates a new instrumented type with the given type variable defined.InstrumentedType.WithFlexibleName
withTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer)
Applies a transformation onto all existing type variables of this instrumented 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, getActualModifiers, getActualName, getDefaultValue, getEnclosingSource, getGenericSignature, 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.ByteCodeElement
getDescriptor, getGenericSignature, isAccessibleTo, isVisibleTo
-
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.NamedElement
getActualName
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithRuntimeName
getInternalName
-
Methods inherited from interface net.bytebuddy.description.type.TypeDefinition
asErasure, asGenericType, getSort, getStackSize, getTypeName, isArray, isPrimitive, represents
-
Methods inherited from interface net.bytebuddy.description.type.TypeDescription
asBoxed, asUnboxed, getActualModifiers, getCanonicalName, getComponentType, getDefaultValue, getInheritedAnnotations, getInnerClassCount, getSimpleName, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isInnerClass, isInstance, isNestedClass, isPackageType, isPrimitiveWrapper, isSamePackage
-
Methods inherited from interface net.bytebuddy.description.TypeVariableSource
accept, findVariable, getEnclosingSource, isGenerified
-
-
-
-
Constructor Detail
-
Default
protected Default(java.lang.String name, int modifiers, TypeDescription.Generic superClass, java.util.List<? extends TypeVariableToken> typeVariables, java.util.List<? extends TypeDescription.Generic> interfaceTypes, java.util.List<? extends FieldDescription.Token> fieldTokens, java.util.List<? extends MethodDescription.Token> methodTokens, java.util.List<? extends AnnotationDescription> annotationDescriptions, TypeInitializer typeInitializer, LoadedTypeInitializer loadedTypeInitializer, TypeDescription declaringType, MethodDescription enclosingMethod, TypeDescription enclosingType, java.util.List<? extends TypeDescription> declaredTypes, boolean memberClass, boolean anonymousClass, boolean localClass)
Creates a new instrumented type.- Parameters:
name
- The binary name of the instrumented type.modifiers
- The modifiers of the instrumented type.typeVariables
- The instrumented type's type variables in their tokenized form.superClass
- The generic super type of the instrumented type.interfaceTypes
- A list of interfaces of the instrumented type.fieldTokens
- A list of field tokens describing the fields of the instrumented type.methodTokens
- A list of method tokens describing the methods of the instrumented type.annotationDescriptions
- A list of annotations of the annotated type.typeInitializer
- The type initializer of the instrumented type.loadedTypeInitializer
- The loaded type initializer of the instrumented type.declaringType
- The declaring type of the instrumented type ornull
if no such type exists.enclosingMethod
- The enclosing method of the instrumented type ornull
if no such type exists.enclosingType
- The enclosing type of the instrumented type ornull
if no such type exists.declaredTypes
- A list of types that are declared by this type.memberClass
-true
if this type is a member class.anonymousClass
-true
if this type is a anonymous class.localClass
-true
if this type is a local class.
-
-
Method Detail
-
of
public static InstrumentedType of(java.lang.String name, TypeDescription.Generic superClass, ModifierContributor.ForType... modifierContributor)
Creates a new instrumented type.- Parameters:
name
- The type's name.superClass
- The type's super class.modifierContributor
- The type's modifiers.- Returns:
- An appropriate instrumented type.
-
of
public static InstrumentedType of(java.lang.String name, TypeDescription.Generic superClass, int modifiers)
Creates a new instrumented type.- Parameters:
name
- The type's name.superClass
- The type's super class.modifiers
- The type's modifiers.- Returns:
- An appropriate instrumented type.
-
withModifiers
public InstrumentedType.WithFlexibleName withModifiers(int modifiers)
Description copied from interface:InstrumentedType
Creates a new instrumented type with changed modifiers.- Specified by:
withModifiers
in interfaceInstrumentedType
- Specified by:
withModifiers
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
modifiers
- The instrumented type's modifiers.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given modifiers.
-
withField
public InstrumentedType.WithFlexibleName withField(FieldDescription.Token token)
Description copied from interface:InstrumentedType
Creates a new instrumented type that includes a new field.- Specified by:
withField
in interfaceInstrumentedType
- Specified by:
withField
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
token
- A token that represents the field's shape. This token must represent types in their detached state.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional field.
-
withMethod
public InstrumentedType.WithFlexibleName withMethod(MethodDescription.Token token)
Description copied from interface:InstrumentedType
Creates a new instrumented type that includes a new method or constructor.- Specified by:
withMethod
in interfaceInstrumentedType
- Specified by:
withMethod
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
token
- A token that represents the method's shape. This token must represent types in their detached state.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional method.
-
withInterfaces
public InstrumentedType.WithFlexibleName withInterfaces(TypeList.Generic interfaceTypes)
Description copied from interface:InstrumentedType
Creates a new instrumented type with the given interfaces implemented.- Specified by:
withInterfaces
in interfaceInstrumentedType
- Specified by:
withInterfaces
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
interfaceTypes
- The interface types to implement.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given interfaces implemented.
-
withAnnotations
public InstrumentedType.WithFlexibleName withAnnotations(java.util.List<? extends AnnotationDescription> annotationDescriptions)
Description copied from interface:InstrumentedType
Creates a new instrumented type with the given annotations.- Specified by:
withAnnotations
in interfaceInstrumentedType
- Specified by:
withAnnotations
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
annotationDescriptions
- The annotations to add to the instrumented type.- Returns:
- A new instrumented type that is equal to this instrumented type but annotated with the given annotations
-
withTypeVariable
public InstrumentedType.WithFlexibleName withTypeVariable(TypeVariableToken typeVariable)
Description copied from interface:InstrumentedType
Creates a new instrumented type with the given type variable defined.- Specified by:
withTypeVariable
in interfaceInstrumentedType
- Specified by:
withTypeVariable
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
typeVariable
- The type variable to declare.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given type variable declared.
-
withName
public InstrumentedType.WithFlexibleName withName(java.lang.String name)
Description copied from interface:InstrumentedType.WithFlexibleName
Creates a new instrumented type with a changed name.- Specified by:
withName
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
name
- The name of the instrumented type.- Returns:
- A new instrumented type that has the given name.
-
withTypeVariables
public InstrumentedType.WithFlexibleName withTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer)
Description copied from interface:InstrumentedType.WithFlexibleName
Applies a transformation onto all existing type variables of this instrumented type. A transformation is potentially unsafe and it is the responsibility of the supplier to return a valid type variable token from the transformer.- Specified by:
withTypeVariables
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
matcher
- The matcher to decide what type variables to transform.transformer
- The transformer to apply on all matched type variables.- Returns:
- A new instrumented type with all matched type variables transformed.
-
withInitializer
public InstrumentedType.WithFlexibleName withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Description copied from interface:InstrumentedType
Creates a new instrumented type that includes the givenLoadedTypeInitializer
.- Specified by:
withInitializer
in interfaceInstrumentedType
- Specified by:
withInitializer
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
loadedTypeInitializer
- The type initializer to include.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional type initializer.
-
withInitializer
public InstrumentedType.WithFlexibleName withInitializer(ByteCodeAppender byteCodeAppender)
Description copied from interface:InstrumentedType
Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.- Specified by:
withInitializer
in interfaceInstrumentedType
- Specified by:
withInitializer
in interfaceInstrumentedType.WithFlexibleName
- Parameters:
byteCodeAppender
- The byte code to add to the type initializer.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given stack manipulation attached to its type initializer.
-
getLoadedTypeInitializer
public LoadedTypeInitializer getLoadedTypeInitializer()
Description copied from interface:InstrumentedType
Returns theLoadedTypeInitializer
s that were registered for this instrumented type.- Specified by:
getLoadedTypeInitializer
in interfaceInstrumentedType
- Returns:
- The registered loaded type initializers for this instrumented type.
-
getTypeInitializer
public TypeInitializer getTypeInitializer()
Description copied from interface:InstrumentedType
Returns this instrumented type's type initializer.- Specified by:
getTypeInitializer
in interfaceInstrumentedType
- Returns:
- This instrumented type's type initializer.
-
getEnclosingMethod
public MethodDescription getEnclosingMethod()
Description copied from interface:TypeDescription
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.- Specified by:
getEnclosingMethod
in interfaceTypeDescription
- Returns:
- A description of the enclosing method of this type or
null
if there is no such method.
-
getEnclosingType
public TypeDescription getEnclosingType()
Description copied from interface:TypeDescription
Returns a description of this type's enclosing type if any.- Specified by:
getEnclosingType
in interfaceTypeDescription
- Returns:
- A description of the enclosing type of this type or
null
if there is no such type.
-
getDeclaredTypes
public TypeList getDeclaredTypes()
Description copied from interface:TypeDescription
Returns a list of types that are declared by this type excluding anonymous classes.- Specified by:
getDeclaredTypes
in interfaceTypeDescription
- Returns:
- A list of types that are declared within this type.
-
isAnonymousClass
public boolean isAnonymousClass()
Description copied from interface:TypeDescription
Checks if this type description represents an anonymous type.- Specified by:
isAnonymousClass
in interfaceTypeDescription
- Returns:
true
if this type description represents an anonymous type.
-
isLocalClass
public boolean isLocalClass()
Description copied from interface:TypeDescription
Checks if this type description represents a local type.- Specified by:
isLocalClass
in interfaceTypeDescription
- Returns:
true
if this type description represents a local type.
-
isMemberClass
public boolean isMemberClass()
Description copied from interface:TypeDescription
Checks if this type description represents a member type.- Specified by:
isMemberClass
in interfaceTypeDescription
- Returns:
true
if this type description represents a member type.
-
getPackage
public PackageDescription getPackage()
Description copied from interface:TypeDescription
Returns the package internalName of the type described by this instance.- Specified by:
getPackage
in interfaceTypeDescription
- Returns:
- The package internalName of the type described by this instance.
-
getDeclaredAnnotations
public AnnotationList getDeclaredAnnotations()
Description copied from interface:AnnotationSource
Returns a list of annotations that are declared by this instance.- Specified by:
getDeclaredAnnotations
in interfaceAnnotationSource
- Returns:
- A list of declared annotations.
-
getDeclaringType
public TypeDescription getDeclaringType()
Description copied from interface:DeclaredByType
Returns the declaring type of this instance.- Specified by:
getDeclaringType
in interfaceDeclaredByType
- Specified by:
getDeclaringType
in interfaceTypeDescription
- Returns:
- The declaring type or
null
if no such type exists.
-
getSuperClass
public TypeDescription.Generic getSuperClass()
Description copied from interface:TypeDefinition
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
- Returns:
- The super class of this type or
null
if no super class exists for this type.
-
getInterfaces
public TypeList.Generic getInterfaces()
Description copied from interface:TypeDefinition
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
- Returns:
- The interfaces that this type implements.
-
getDeclaredFields
public FieldList<FieldDescription.InDefinedShape> getDeclaredFields()
Description copied from interface:TypeDefinition
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
- 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:TypeDefinition
Returns the methods that this type declares.- Specified by:
getDeclaredMethods
in interfaceTypeDefinition
- Specified by:
getDeclaredMethods
in interfaceTypeDescription
- Returns:
- The methods that this type declares.
-
getTypeVariables
public TypeList.Generic getTypeVariables()
Description copied from interface:TypeVariableSource
Returns the type variables that are declared by this element.- Specified by:
getTypeVariables
in interfaceTypeVariableSource
- Returns:
- The type variables that are declared by this element.
-
getModifiers
public int getModifiers()
Description copied from interface:ModifierReviewable
Returns the modifier that is described by this object.- Specified by:
getModifiers
in interfaceModifierReviewable
- Returns:
- The modifier that is described by this object.
-
getName
public java.lang.String getName()
Description copied from interface:NamedElement.WithRuntimeName
Returns the internalName of this byte code element.- Specified by:
getName
in interfaceNamedElement.WithRuntimeName
- Returns:
- The internalName of this byte code element as visible from within a running Java application.
-
validated
public TypeDescription validated()
Description copied from interface:InstrumentedType
Validates the instrumented type to define a legal Java type.- Specified by:
validated
in interfaceInstrumentedType
- Returns:
- This instrumented type as a non-modifiable type description.
-
-