public static class InstrumentedType.Default extends TypeDescription.AbstractBase.OfSimpleType implements InstrumentedType.WithFlexibleName
TypeDescription.AbstractBase.OfSimpleType.WithDelegationTypeDescription.AbstractBase.OfSimpleTypeInstrumentedType.Default, InstrumentedType.Prepareable, InstrumentedType.WithFlexibleNameTypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.Generic, TypeDescription.LatentTypeDefinition.Sort, TypeDefinition.SuperClassIteratorModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumerationByteCodeElement.Token<T extends ByteCodeElement.Token<T>>, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeNameTypeVariableSource.Visitor<T>ARRAY_INTERFACES, CLASS, OBJECT, STRING, THROWABLE, UNDEFINED, VOIDEMPTY_MASKNON_GENERIC_SIGNATUREEMPTY_NAME, NO_NAME| Modifier | Constructor and Description |
|---|---|
protected |
Default(String name,
int modifiers,
TypeDescription.Generic superClass,
List<? extends TypeVariableToken> typeVariables,
List<? extends TypeDescription.Generic> interfaceTypes,
List<? extends FieldDescription.Token> fieldTokens,
List<? extends MethodDescription.Token> methodTokens,
List<? extends AnnotationDescription> annotationDescriptions,
TypeInitializer typeInitializer,
LoadedTypeInitializer loadedTypeInitializer,
TypeDescription declaringType,
MethodDescription enclosingMethod,
TypeDescription enclosingType,
List<? extends TypeDescription> declaredTypes,
boolean memberClass,
boolean anonymousClass,
boolean localClass)
Creates a new instrumented type.
|
| Modifier and Type | Method and 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 the
LoadedTypeInitializers that were registered
for this instrumented type. |
int |
getModifiers()
Returns the modifier that is described by this object.
|
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.WithFlexibleName |
of(TypeDescription typeDescription)
Creates an instrumented type that represents the given type description.
|
static InstrumentedType.WithFlexibleName |
subclass(String name,
int modifiers,
TypeDescription.Generic superClass)
Creates an instrumented type that is a subclass of the given super type named as given and with the modifiers.
|
TypeDescription |
validated()
Validates the instrumented type to define a legal Java type.
|
InstrumentedType.WithFlexibleName |
withAnnotations(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 given
LoadedTypeInitializer. |
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(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.
|
getCanonicalName, getComponentType, getDescriptor, getSimpleName, getStackSize, isArray, isPrimitiveaccept, asErasure, asGenericType, equals, getActualModifiers, getActualName, getEnclosingSource, getGenericSignature, getInheritedAnnotations, getInternalName, getSegmentCount, getSort, getTypeName, hashCode, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isGenericDeclaration, isInstance, isInstanceOrWrapper, isPackageType, isPrimitiveWrapper, isSamePackage, isVisibleTo, iterator, represents, toStringfindVariableisAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetActualModifiers, getCanonicalName, getComponentType, getInheritedAnnotations, getSegmentCount, getSimpleName, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isInstance, isInstanceOrWrapper, isPackageType, isPrimitiveWrapper, isSamePackageasErasure, asGenericType, getSort, getStackSize, getTypeName, isArray, isPrimitive, representsisAnnotation, isInterfaceisAbstractisEnumisDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticisFinal, isSyntheticforEach, iterator, spliteratorgetDescriptor, getGenericSignature, isVisibleTogetInternalNamegetActualNameaccept, findVariable, getEnclosingSource, isGenericDeclarationprotected Default(String name, int modifiers, TypeDescription.Generic superClass, List<? extends TypeVariableToken> typeVariables, List<? extends TypeDescription.Generic> interfaceTypes, List<? extends FieldDescription.Token> fieldTokens, List<? extends MethodDescription.Token> methodTokens, List<? extends AnnotationDescription> annotationDescriptions, TypeInitializer typeInitializer, LoadedTypeInitializer loadedTypeInitializer, TypeDescription declaringType, MethodDescription enclosingMethod, TypeDescription enclosingType, List<? extends TypeDescription> declaredTypes, boolean memberClass, boolean anonymousClass, boolean localClass)
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 or null if no such type exists.enclosingMethod - The enclosing method of the instrumented type or null if no such type exists.enclosingType - The enclosing type of the instrumented type or null 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.public static InstrumentedType.WithFlexibleName subclass(String name, int modifiers, TypeDescription.Generic superClass)
name - The name of the instrumented type.modifiers - The modifiers of the instrumented type.superClass - The super type of the instrumented type.public static InstrumentedType.WithFlexibleName of(TypeDescription typeDescription)
typeDescription - A description of the type to represent.public InstrumentedType.WithFlexibleName withModifiers(int modifiers)
InstrumentedTypewithModifiers in interface InstrumentedTypewithModifiers in interface InstrumentedType.WithFlexibleNamemodifiers - The instrumented type's modifiers.public InstrumentedType.WithFlexibleName withField(FieldDescription.Token token)
InstrumentedTypewithField in interface InstrumentedTypewithField in interface InstrumentedType.WithFlexibleNametoken - A token that represents the field's shape. This token must represent types in their detached state.public InstrumentedType.WithFlexibleName withMethod(MethodDescription.Token token)
InstrumentedTypewithMethod in interface InstrumentedTypewithMethod in interface InstrumentedType.WithFlexibleNametoken - A token that represents the method's shape. This token must represent types in their detached state.public InstrumentedType.WithFlexibleName withInterfaces(TypeList.Generic interfaceTypes)
InstrumentedTypewithInterfaces in interface InstrumentedTypewithInterfaces in interface InstrumentedType.WithFlexibleNameinterfaceTypes - The interface types to implement.public InstrumentedType.WithFlexibleName withAnnotations(List<? extends AnnotationDescription> annotationDescriptions)
InstrumentedTypewithAnnotations in interface InstrumentedTypewithAnnotations in interface InstrumentedType.WithFlexibleNameannotationDescriptions - The annotations to add to the instrumented type.public InstrumentedType.WithFlexibleName withTypeVariable(TypeVariableToken typeVariable)
InstrumentedTypewithTypeVariable in interface InstrumentedTypewithTypeVariable in interface InstrumentedType.WithFlexibleNametypeVariable - The type variable to declare.public InstrumentedType.WithFlexibleName withName(String name)
InstrumentedType.WithFlexibleNamewithName in interface InstrumentedType.WithFlexibleNamename - The name of the instrumented type.public InstrumentedType.WithFlexibleName withTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer)
InstrumentedType.WithFlexibleNamewithTypeVariables in interface InstrumentedType.WithFlexibleNamematcher - The matcher to decide what type variables to transform.transformer - The transformer to apply on all matched type variables.public InstrumentedType.WithFlexibleName withInitializer(LoadedTypeInitializer loadedTypeInitializer)
InstrumentedTypeLoadedTypeInitializer.withInitializer in interface InstrumentedTypewithInitializer in interface InstrumentedType.WithFlexibleNameloadedTypeInitializer - The type initializer to include.public InstrumentedType.WithFlexibleName withInitializer(ByteCodeAppender byteCodeAppender)
InstrumentedTypewithInitializer in interface InstrumentedTypewithInitializer in interface InstrumentedType.WithFlexibleNamebyteCodeAppender - The byte code to add to the type initializer.public LoadedTypeInitializer getLoadedTypeInitializer()
InstrumentedTypeLoadedTypeInitializers that were registered
for this instrumented type.getLoadedTypeInitializer in interface InstrumentedTypepublic TypeInitializer getTypeInitializer()
InstrumentedTypegetTypeInitializer in interface InstrumentedTypepublic MethodDescription getEnclosingMethod()
TypeDescriptionnull is returned by this method.getEnclosingMethod in interface TypeDescriptionnull if there is no such method.public TypeDescription getEnclosingType()
TypeDescriptiongetEnclosingType in interface TypeDescriptionnull if there is no such type.public TypeList getDeclaredTypes()
TypeDescriptiongetDeclaredTypes in interface TypeDescriptionpublic boolean isAnonymousClass()
TypeDescriptionisAnonymousClass in interface TypeDescriptiontrue if this type description represents an anonymous type.public boolean isLocalClass()
TypeDescriptionisLocalClass in interface TypeDescriptiontrue if this type description represents a local type.public boolean isMemberClass()
TypeDescriptionisMemberClass in interface TypeDescriptiontrue if this type description represents a member type.public PackageDescription getPackage()
TypeDescriptiongetPackage in interface TypeDescriptionpublic AnnotationList getDeclaredAnnotations()
AnnotatedCodeElementgetDeclaredAnnotations in interface AnnotatedCodeElementpublic TypeDescription getDeclaringType()
DeclaredByTypegetDeclaringType in interface DeclaredByTypegetDeclaringType in interface TypeDescriptionnull if no such type exists.public TypeDescription.Generic getSuperClass()
TypeDefinitionTypeDefinition.Sort.NON_GENERIC),
parameterized types (TypeDefinition.Sort.PARAMETERIZED) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY) types. Interface types
and the Object class do not define a super class where null is returned. Array types define Object
as their direct super class.getSuperClass in interface TypeDefinitionnull if no super class exists for this type.public TypeList.Generic getInterfaces()
TypeDefinitionTypeDefinition.Sort.NON_GENERIC),
parameterized types (TypeDefinition.Sort.PARAMETERIZED) or generic array types (TypeDefinition.Sort.GENERIC_ARRAY) types.getInterfaces in interface TypeDefinitionpublic FieldList<FieldDescription.InDefinedShape> getDeclaredFields()
TypeDefinitionTypeDefinition.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.getDeclaredFields in interface TypeDefinitiongetDeclaredFields in interface TypeDescriptionTypeDefinition.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.public MethodList<MethodDescription.InDefinedShape> getDeclaredMethods()
TypeDefinitiongetDeclaredMethods in interface TypeDefinitiongetDeclaredMethods in interface TypeDescriptionpublic TypeList.Generic getTypeVariables()
TypeVariableSourcegetTypeVariables in interface TypeVariableSourcepublic int getModifiers()
ModifierReviewablegetModifiers in interface ModifierReviewablepublic String getName()
NamedElement.WithRuntimeNamegetName in interface NamedElement.WithRuntimeNamepublic TypeDescription validated()
InstrumentedTypevalidated in interface InstrumentedTypeCopyright © 2014–2016. All rights reserved.