public class SubclassInstrumentedType extends InstrumentedType.AbstractBase
InstrumentedType.AbstractBase.FieldToken, InstrumentedType.AbstractBase.MethodTokenTypeDescription.AbstractTypeDescription.OfSimpleTypeInstrumentedType.AbstractBase, InstrumentedType.TypeInitializerTypeDescription.AbstractTypeDescription, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.LatentModifierReviewable.AbstractModifierReviewablefieldDescriptions, loadedTypeInitializer, methodDescriptions, typeInitializerCLASS, ENUM, OBJECT, STRING, VOIDEMPTY_NAMEEMPTY_MASK| Modifier | Constructor and Description |
|---|---|
|
SubclassInstrumentedType(ClassFileVersion classFileVersion,
TypeDescription superClass,
List<TypeDescription> interfaces,
int modifiers,
NamingStrategy namingStrategy)
Creates a new immutable type instrumentation for a loaded superclass.
|
protected |
SubclassInstrumentedType(ClassFileVersion classFileVersion,
TypeDescription superClass,
List<TypeDescription> interfaces,
int modifiers,
String name,
List<? extends FieldDescription> fieldDescriptions,
List<? extends MethodDescription> methodDescriptions,
LoadedTypeInitializer loadedTypeInitializer,
InstrumentedType.TypeInitializer typeInitializer)
Creates a new immutable type instrumentation for a loaded superclass.
|
| Modifier and Type | Method and Description |
|---|---|
TypeDescription |
detach()
Creates a compressed version of this instrumented type which only needs to fulfil the
TypeDescription interface. |
AnnotationList |
getDeclaredAnnotations()
Returns a list of annotations that are declared by this instance.
|
AnnotationList |
getInheritedAnnotations()
Returns the annotations that this type declares or inherits from super types.
|
TypeList |
getInterfaces()
Returns a list of interfaces that are implemented by this type.
|
int |
getModifiers()
Returns the modifier that is described by this object.
|
String |
getName()
Returns the internalName of this byte code element.
|
TypeDescription |
getSupertype()
Returns the component type of this type.
|
InstrumentedType |
withField(String internalName,
TypeDescription fieldType,
int modifiers)
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(String internalName,
TypeDescription returnType,
List<? extends TypeDescription> parameterTypes,
List<? extends TypeDescription> exceptionTypes,
int modifiers)
Creates a new instrumented type that includes a new method or constructor.
|
getCanonicalName, getDeclaredFields, getDeclaredMethods, getDeclaringType, getEnclosingMethod, getEnclosingType, getLoadedTypeInitializer, getPackage, getTypeInitializer, isAnonymousClass, isLocalClass, isMemberClassgetComponentType, getDescriptor, getSimpleName, getStackSize, isArray, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isInstance, isPrimitive, representsequals, getActualModifiers, getGenericSignature, getInheritedInterfaces, getInternalName, getPackageName, getSourceCodeName, hashCode, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isConstantPool, isInstanceOrWrapper, isPrimitiveWrapper, isSamePackage, isVisibleTo, 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, getComponentType, getInheritedInterfaces, getSimpleName, getStackSize, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isArray, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isConstantPool, isInstance, isInstanceOrWrapper, isPrimitive, isPrimitiveWrapper, isSamePackage, representsgetDescriptor, getGenericSignature, isVisibleTogetInternalName, getSourceCodeNameisAbstract, isAnnotation, isBridge, isDeprecated, isEnum, isFinal, isInterface, isMandated, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSuper, isSynchronized, isSynthetic, isTransient, isVarArgs, isVolatilepublic SubclassInstrumentedType(ClassFileVersion classFileVersion, TypeDescription superClass, List<TypeDescription> interfaces, int modifiers, NamingStrategy namingStrategy)
classFileVersion - The class file version of this instrumentation.superClass - The superclass of this instrumentation.interfaces - A collection of loaded interfaces that are implemented by this instrumented class.modifiers - The modifiers for this instrumentation.namingStrategy - The naming strategy to be applied for this instrumentation.protected SubclassInstrumentedType(ClassFileVersion classFileVersion, TypeDescription superClass, List<TypeDescription> interfaces, int modifiers, String name, List<? extends FieldDescription> fieldDescriptions, List<? extends MethodDescription> methodDescriptions, LoadedTypeInitializer loadedTypeInitializer, InstrumentedType.TypeInitializer typeInitializer)
classFileVersion - The class file version of this instrumentation.superClass - The superclass of this instrumentation.interfaces - A collection of loaded interfaces that are implemented by this instrumented class.modifiers - The modifiers for this instrumentation.name - The name of this instrumented type.fieldDescriptions - A list of field descriptions to be applied for this instrumentation.methodDescriptions - A list of method descriptions to be applied for this instrumentation.loadedTypeInitializer - A loaded type initializer to be applied for this instrumentation.typeInitializer - A type initializer to be applied for this instrumentation.public InstrumentedType withField(String internalName, TypeDescription fieldType, int modifiers)
InstrumentedTypeinternalName - The internal name of the new field.fieldType - A description of the type of the new field.modifiers - The modifier of the new field.public InstrumentedType withMethod(String internalName, TypeDescription returnType, List<? extends TypeDescription> parameterTypes, List<? extends TypeDescription> exceptionTypes, int modifiers)
InstrumentedTypeinternalName - The internal name of the new field.returnType - A description of the return type of the new field.parameterTypes - A list of descriptions of the parameter types.exceptionTypes - A list of descriptions of the exception types that are declared by this method.modifiers - The modifier of the new field.public InstrumentedType withInitializer(LoadedTypeInitializer loadedTypeInitializer)
InstrumentedTypeLoadedTypeInitializer.loadedTypeInitializer - The type initializer to include.public InstrumentedType withInitializer(ByteCodeAppender byteCodeAppender)
InstrumentedTypebyteCodeAppender - The byte code to add to the type initializer.public TypeDescription detach()
InstrumentedTypeTypeDescription interface. This allows
for a potential compression of the representation of this instrumented type.this instrumented type.public TypeDescription getSupertype()
TypeDescriptionnull if type does not have a super type as for the
Object type.public TypeList getInterfaces()
TypeDescriptionpublic String getName()
NamedElementpublic int getModifiers()
ModifierReviewablepublic AnnotationList getDeclaredAnnotations()
AnnotatedCodeElementpublic AnnotationList getInheritedAnnotations()
TypeDescriptiongetInheritedAnnotations in interface TypeDescriptiongetInheritedAnnotations in class TypeDescription.AbstractTypeDescriptionCopyright © 2014–2015. All rights reserved.