public static class InstrumentedType.Default extends TypeDescription.AbstractBase.OfSimpleType implements InstrumentedType
TypeDescription.AbstractBase.OfSimpleType, TypeDescription.AbstractBase.RawTypeWrapperInstrumentedType.Default, InstrumentedType.TypeInitializerTypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.LatentGenericTypeDescription.ForGenericArray, GenericTypeDescription.ForNonGenericType, GenericTypeDescription.ForParameterizedType, GenericTypeDescription.ForTypeVariable, GenericTypeDescription.ForWildcardType, GenericTypeDescription.LazyProjection, GenericTypeDescription.Sort, GenericTypeDescription.SuperTypeIterator, GenericTypeDescription.Visitor<T>TypeVariableSource.Visitor<T>ByteCodeElement.Accessible, ByteCodeElement.Token<T extends ByteCodeElement.Token<T>>, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>NamedElement.WithGenericName, NamedElement.WithRuntimeNameARRAY_INTERFACES, ARRAY_MODIFIERS, CLASS, ENUM, OBJECT, STRING, UNDEFINED, VOIDNON_GENERIC_SIGNATUREEMPTY_NAME, NO_NAMEEMPTY_MASK| Constructor and Description |
|---|
Default(String name,
int modifiers,
List<? extends GenericTypeDescription> typeVariables,
GenericTypeDescription superType,
List<? extends GenericTypeDescription> interfaceTypes,
List<? extends FieldDescription.Token> fieldTokens,
List<? extends MethodDescription.Token> methodTokens,
List<? extends AnnotationDescription> annotationDescriptions,
InstrumentedType.TypeInitializer typeInitializer,
LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type with default values for any properties that only exist for types that are declared within another type.
|
Default(String name,
int modifiers,
List<? extends GenericTypeDescription> typeVariables,
GenericTypeDescription superType,
List<? extends GenericTypeDescription> interfaceTypes,
List<? extends FieldDescription.Token> fieldTokens,
List<? extends MethodDescription.Token> methodTokens,
List<? extends AnnotationDescription> annotationDescriptions,
InstrumentedType.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 a list of field descriptions that are declared by this type.
|
protected GenericTypeList |
getDeclaredInterfaces()
Returns the declared interface types in the form they are declared in the class file.
|
MethodList<MethodDescription.InDefinedShape> |
getDeclaredMethods()
Returns a list of method descriptions that are declared by this type.
|
protected GenericTypeDescription |
getDeclaredSuperType()
Returns the declared super type in the form it is declared in the class file.
|
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 enclosing method of this type.
|
TypeDescription |
getEnclosingType()
Returns a description of the enclosing type of this type.
|
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.
|
InstrumentedType.TypeInitializer |
getTypeInitializer()
Returns this instrumented type's type initializer.
|
GenericTypeList |
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.
|
InstrumentedType |
withField(FieldDescription.Token fieldToken)
Creates a new instrumented type that includes a new field.
|
InstrumentedType |
withInitializer(ByteCodeAppender byteCodeAppender)
Creates a new instrumented type that executes the given initializer in the instrumented type's
type initializer.
|
InstrumentedType |
withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the given
LoadedTypeInitializer. |
InstrumentedType |
withMethod(MethodDescription.Token methodToken)
Creates a new instrumented type that includes a new method or constructor.
|
getCanonicalName, getComponentType, getDescriptor, getSimpleName, getStackSize, isArray, isPrimitiveaccept, accept, asErasure, equals, findVariable, getActualModifiers, getEnclosingSource, getGenericSignature, getInheritedAnnotations, getInterfaces, getInternalName, getLowerBounds, getOwnerType, getParameters, getSort, getSourceCodeName, getSuperType, getSymbol, getTypeName, getUpperBounds, getVariableSource, hashCode, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isInstance, isInstanceOrWrapper, isPrimitiveWrapper, isSamePackage, isVisibleTo, iterator, represents, toStringisAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatileclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetActualModifiers, getCanonicalName, getComponentType, getInheritedAnnotations, getOwnerType, getSimpleName, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isInstance, isInstanceOrWrapper, isPrimitiveWrapper, isSamePackageaccept, asErasure, getInterfaces, getLowerBounds, getParameters, getSort, getStackSize, getSuperType, getSymbol, getTypeName, getUpperBounds, getVariableSource, isArray, isPrimitive, representsforEach, iterator, spliteratoraccept, findVariable, getEnclosingSourcegetDescriptor, getGenericSignature, isVisibleTogetInternalNamegetSourceCodeNameisAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatilepublic Default(String name, int modifiers, List<? extends GenericTypeDescription> typeVariables, GenericTypeDescription superType, List<? extends GenericTypeDescription> interfaceTypes, List<? extends FieldDescription.Token> fieldTokens, List<? extends MethodDescription.Token> methodTokens, List<? extends AnnotationDescription> annotationDescriptions, InstrumentedType.TypeInitializer typeInitializer, LoadedTypeInitializer loadedTypeInitializer)
name - The binary name of the instrumented type.modifiers - The modifiers of the instrumented type.typeVariables - A list of type variables of the instrumented type.superType - 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.public Default(String name, int modifiers, List<? extends GenericTypeDescription> typeVariables, GenericTypeDescription superType, List<? extends GenericTypeDescription> interfaceTypes, List<? extends FieldDescription.Token> fieldTokens, List<? extends MethodDescription.Token> methodTokens, List<? extends AnnotationDescription> annotationDescriptions, InstrumentedType.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 - A list of type variables of the instrumented type.superType - 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 InstrumentedType withField(FieldDescription.Token fieldToken)
InstrumentedTypewithField in interface InstrumentedTypefieldToken - A token that represents the field's shape. This token must represent types in their detached state.public InstrumentedType withMethod(MethodDescription.Token methodToken)
InstrumentedTypewithMethod in interface InstrumentedTypemethodToken - A token that represents the method's shape. This token must represent types in their detached state.public InstrumentedType withInitializer(LoadedTypeInitializer loadedTypeInitializer)
InstrumentedTypeLoadedTypeInitializer.withInitializer in interface InstrumentedTypeloadedTypeInitializer - The type initializer to include.public InstrumentedType withInitializer(ByteCodeAppender byteCodeAppender)
InstrumentedTypewithInitializer in interface InstrumentedTypebyteCodeAppender - The byte code to add to the type initializer.public LoadedTypeInitializer getLoadedTypeInitializer()
InstrumentedTypeLoadedTypeInitializers that were registered
for this instrumented type.getLoadedTypeInitializer in interface InstrumentedTypepublic InstrumentedType.TypeInitializer getTypeInitializer()
InstrumentedTypegetTypeInitializer in interface InstrumentedTypepublic MethodDescription getEnclosingMethod()
TypeDescriptiongetEnclosingMethod 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.protected GenericTypeDescription getDeclaredSuperType()
TypeDescription.AbstractBasegetDeclaredSuperType in class TypeDescription.AbstractBaseprotected GenericTypeList getDeclaredInterfaces()
TypeDescription.AbstractBasegetDeclaredInterfaces in class TypeDescription.AbstractBasepublic FieldList<FieldDescription.InDefinedShape> getDeclaredFields()
GenericTypeDescriptionReturns a list of field descriptions that are declared by this type. For parameterized types, all type variables of these fields are resolved to the values of the type variables.
Only non-generic types (GenericTypeDescription.Sort.NON_GENERIC) and parameterized types
(GenericTypeDescription.Sort.PARAMETERIZED) define a super type. For a generic array type,
(GenericTypeDescription.Sort.GENERIC_ARRAY), an empty list is returned. For other generic
types, an IllegalStateException is thrown.
getDeclaredFields in interface GenericTypeDescriptiongetDeclaredFields in interface TypeDescriptionpublic MethodList<MethodDescription.InDefinedShape> getDeclaredMethods()
GenericTypeDescriptionReturns a list of method descriptions that are declared by this type. For parameterized types, all type variables used by these methods are resolved to the values of the type variables.
Only non-generic types (GenericTypeDescription.Sort.NON_GENERIC) and parameterized types
(GenericTypeDescription.Sort.PARAMETERIZED) define a super type. For a generic array type,
(GenericTypeDescription.Sort.GENERIC_ARRAY), an empty list is returned. For other
generic types, an IllegalStateException is thrown.
getDeclaredMethods in interface GenericTypeDescriptiongetDeclaredMethods in interface TypeDescriptionpublic GenericTypeList getTypeVariables()
TypeVariableSourcegetTypeVariables in interface TypeVariableSourcepublic int getModifiers()
ModifierReviewablegetModifiers in interface ModifierReviewablepublic String getName()
NamedElement.WithRuntimeNamegetName in interface NamedElement.WithRuntimeNameCopyright © 2014–2015. All rights reserved.