S
- The best known loaded type for the dynamically created type.public abstract static class TypeWriter.Default<S> extends Object implements TypeWriter<S>
TypeWriter
.Modifier and Type | Class and Description |
---|---|
static class |
TypeWriter.Default.ForCreation<U>
A type writer that creates a class file that is not based upon another, existing class.
|
static class |
TypeWriter.Default.ForInlining<U>
A type writer that inlines the created type into an existing class file.
|
protected static class |
TypeWriter.Default.FrameComputingClassWriter
A class writer that piggy-backs on Byte Buddy's
ClassFileLocator to avoid class loading or look-up errors when redefining a class. |
protected static class |
TypeWriter.Default.ValidatingClassVisitor
A class validator that validates that a class only defines members that are appropriate for the sort of the generated class.
|
TypeWriter.Default<S>, TypeWriter.FieldPool, TypeWriter.MethodPool
Modifier and Type | Field and Description |
---|---|
protected AnnotationRetention |
annotationRetention
The annotation retention to apply.
|
protected AnnotationValueFilter.Factory |
annotationValueFilterFactory
The annotation value filter factory to apply.
|
protected static int |
ASM_MANUAL_FLAGS
Indicates to ASM that no values should be computed.
|
protected AsmVisitorWrapper |
asmVisitorWrapper
The ASM visitor wrapper to apply onto the class writer.
|
protected AuxiliaryType.NamingStrategy |
auxiliaryTypeNamingStrategy
The naming strategy for auxiliary types to apply.
|
protected ClassFileVersion |
classFileVersion
The class file version to use when no explicit class file version is applied.
|
protected List<DynamicType> |
explicitAuxiliaryTypes
The explicit auxiliary types to add to the created type.
|
protected TypeWriter.FieldPool |
fieldPool
The field pool to use.
|
protected Implementation.Context.Factory |
implementationContextFactory
The implementation context factory to apply.
|
protected MethodList<?> |
instrumentedMethods
The instrumented methods relevant to this type creation.
|
protected TypeDescription |
instrumentedType
The instrumented type to be created.
|
protected LoadedTypeInitializer |
loadedTypeInitializer
The loaded type initializer to apply onto the created type after loading.
|
protected TypeWriter.MethodPool |
methodPool
The method pool to use.
|
protected TypeAttributeAppender |
typeAttributeAppender
The type attribute appender to apply onto the instrumented type.
|
protected TypeInitializer |
typeInitializer
The type initializer to include in the created type's type initializer.
|
protected TypeValidation |
typeValidation
Determines if a type should be explicitly validated.
|
Modifier | Constructor and Description |
---|---|
protected |
Default(TypeDescription instrumentedType,
TypeWriter.FieldPool fieldPool,
TypeWriter.MethodPool methodPool,
List<DynamicType> explicitAuxiliaryTypes,
MethodList<?> instrumentedMethods,
LoadedTypeInitializer loadedTypeInitializer,
TypeInitializer typeInitializer,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation)
Creates a new default type writer.
|
Modifier and Type | Method and Description |
---|---|
protected abstract byte[] |
create(Implementation.Context.ExtractableView implementationContext)
Creates the instrumented type.
|
boolean |
equals(Object other) |
static <U> TypeWriter<U> |
forCreation(MethodRegistry.Compiled methodRegistry,
TypeWriter.FieldPool fieldPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation)
Creates a type writer for creating a new type.
|
static <U> TypeWriter<U> |
forRebasing(MethodRegistry.Compiled methodRegistry,
TypeWriter.FieldPool fieldPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
TypeDescription originalType,
ClassFileLocator classFileLocator,
MethodRebaseResolver methodRebaseResolver)
Creates a type writer for rebasing a type.
|
static <U> TypeWriter<U> |
forRedefinition(MethodRegistry.Compiled methodRegistry,
TypeWriter.FieldPool fieldPool,
TypeAttributeAppender typeAttributeAppender,
AsmVisitorWrapper asmVisitorWrapper,
ClassFileVersion classFileVersion,
AnnotationValueFilter.Factory annotationValueFilterFactory,
AnnotationRetention annotationRetention,
AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy,
Implementation.Context.Factory implementationContextFactory,
TypeValidation typeValidation,
TypeDescription originalType,
ClassFileLocator classFileLocator)
Creates a type writer for redefining a type.
|
int |
hashCode() |
DynamicType.Unloaded<S> |
make()
Creates the dynamic type that is described by this type writer.
|
protected static final int ASM_MANUAL_FLAGS
protected final TypeDescription instrumentedType
protected final TypeWriter.FieldPool fieldPool
protected final TypeWriter.MethodPool methodPool
protected final List<DynamicType> explicitAuxiliaryTypes
protected final MethodList<?> instrumentedMethods
protected final LoadedTypeInitializer loadedTypeInitializer
protected final TypeInitializer typeInitializer
protected final TypeAttributeAppender typeAttributeAppender
protected final AsmVisitorWrapper asmVisitorWrapper
protected final ClassFileVersion classFileVersion
protected final AnnotationValueFilter.Factory annotationValueFilterFactory
protected final AnnotationRetention annotationRetention
protected final AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy
protected final Implementation.Context.Factory implementationContextFactory
protected final TypeValidation typeValidation
protected Default(TypeDescription instrumentedType, TypeWriter.FieldPool fieldPool, TypeWriter.MethodPool methodPool, List<DynamicType> explicitAuxiliaryTypes, MethodList<?> instrumentedMethods, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, TypeAttributeAppender typeAttributeAppender, AsmVisitorWrapper asmVisitorWrapper, ClassFileVersion classFileVersion, AnnotationValueFilter.Factory annotationValueFilterFactory, AnnotationRetention annotationRetention, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, TypeValidation typeValidation)
instrumentedType
- The instrumented type to be created.fieldPool
- The field pool to use.methodPool
- The method pool to use.explicitAuxiliaryTypes
- The explicit auxiliary types to add to the created type.instrumentedMethods
- The instrumented methods relevant to this type creation.loadedTypeInitializer
- The loaded type initializer to apply onto the created type after loading.typeInitializer
- The type initializer to include in the created type's type initializer.typeAttributeAppender
- The type attribute appender to apply onto the instrumented type.asmVisitorWrapper
- The ASM visitor wrapper to apply onto the class writer.classFileVersion
- The class file version to use when no explicit class file version is applied.annotationValueFilterFactory
- The annotation value filter factory to apply.annotationRetention
- The annotation retention to apply.auxiliaryTypeNamingStrategy
- The naming strategy for auxiliary types to apply.implementationContextFactory
- The implementation context factory to apply.typeValidation
- Determines if a type should be explicitly validated.public static <U> TypeWriter<U> forCreation(MethodRegistry.Compiled methodRegistry, TypeWriter.FieldPool fieldPool, TypeAttributeAppender typeAttributeAppender, AsmVisitorWrapper asmVisitorWrapper, ClassFileVersion classFileVersion, AnnotationValueFilter.Factory annotationValueFilterFactory, AnnotationRetention annotationRetention, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, TypeValidation typeValidation)
U
- A loaded type that the instrumented type guarantees to subclass.methodRegistry
- The compiled method registry to use.fieldPool
- The field pool to use.typeAttributeAppender
- The type attribute appender to apply onto the instrumented type.asmVisitorWrapper
- The ASM visitor wrapper to apply onto the class writer.classFileVersion
- The class file version to use when no explicit class file version is applied.annotationValueFilterFactory
- The annotation value filter factory to apply.annotationRetention
- The annotation retention to apply.auxiliaryTypeNamingStrategy
- The naming strategy for auxiliary types to apply.implementationContextFactory
- The implementation context factory to apply.typeValidation
- Determines if a type should be explicitly validated.public static <U> TypeWriter<U> forRedefinition(MethodRegistry.Compiled methodRegistry, TypeWriter.FieldPool fieldPool, TypeAttributeAppender typeAttributeAppender, AsmVisitorWrapper asmVisitorWrapper, ClassFileVersion classFileVersion, AnnotationValueFilter.Factory annotationValueFilterFactory, AnnotationRetention annotationRetention, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, TypeValidation typeValidation, TypeDescription originalType, ClassFileLocator classFileLocator)
U
- A loaded type that the instrumented type guarantees to subclass.methodRegistry
- The compiled method registry to use.fieldPool
- The field pool to use.typeAttributeAppender
- The type attribute appender to apply onto the instrumented type.asmVisitorWrapper
- The ASM visitor wrapper to apply onto the class writer.classFileVersion
- The class file version to use when no explicit class file version is applied.annotationValueFilterFactory
- The annotation value filter factory to apply.annotationRetention
- The annotation retention to apply.auxiliaryTypeNamingStrategy
- The naming strategy for auxiliary types to apply.implementationContextFactory
- The implementation context factory to apply.typeValidation
- Determines if a type should be explicitly validated.originalType
- The original type that is being redefined or rebased.classFileLocator
- The class file locator for locating the original type's class file.public static <U> TypeWriter<U> forRebasing(MethodRegistry.Compiled methodRegistry, TypeWriter.FieldPool fieldPool, TypeAttributeAppender typeAttributeAppender, AsmVisitorWrapper asmVisitorWrapper, ClassFileVersion classFileVersion, AnnotationValueFilter.Factory annotationValueFilterFactory, AnnotationRetention annotationRetention, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, TypeValidation typeValidation, TypeDescription originalType, ClassFileLocator classFileLocator, MethodRebaseResolver methodRebaseResolver)
U
- A loaded type that the instrumented type guarantees to subclass.methodRegistry
- The compiled method registry to use.fieldPool
- The field pool to use.typeAttributeAppender
- The type attribute appender to apply onto the instrumented type.asmVisitorWrapper
- The ASM visitor wrapper to apply onto the class writer.classFileVersion
- The class file version to use when no explicit class file version is applied.annotationValueFilterFactory
- The annotation value filter factory to apply.annotationRetention
- The annotation retention to apply.auxiliaryTypeNamingStrategy
- The naming strategy for auxiliary types to apply.implementationContextFactory
- The implementation context factory to apply.typeValidation
- Determines if a type should be explicitly validated.originalType
- The original type that is being redefined or rebased.classFileLocator
- The class file locator for locating the original type's class file.methodRebaseResolver
- The method rebase resolver to use for rebasing names.public DynamicType.Unloaded<S> make()
TypeWriter
make
in interface TypeWriter<S>
protected abstract byte[] create(Implementation.Context.ExtractableView implementationContext)
implementationContext
- The implementation context to use.Copyright © 2014–2016. All rights reserved.