Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.Default.ForCreation<U>
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.Default<U>
net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ForCreation<U>
- Type Parameters:
U
- The best known loaded type for the dynamically created type.
- All Implemented Interfaces:
TypeWriter<U>
- Enclosing class:
TypeWriter.Default<S>
A type writer that creates a class file that is not based upon another, existing class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A class visitor that applies the subclass creation as a wrapper.protected class
A context class visitor based on anImplementation.Context
.Nested classes/interfaces inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.Default
TypeWriter.Default.ClassDumpAction, TypeWriter.Default.ForCreation<U>, TypeWriter.Default.ForInlining<U>, TypeWriter.Default.SignatureKey, TypeWriter.Default.UnresolvedType, TypeWriter.Default.ValidatingClassVisitor
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter
TypeWriter.Default<S>, TypeWriter.FieldPool, TypeWriter.MethodPool, TypeWriter.RecordComponentPool
-
Field Summary
FieldsFields inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.Default
annotationRetention, annotationValueFilterFactory, asmVisitorWrapper, auxiliaryTypeNamingStrategy, auxiliaryTypes, classFileVersion, classWriterStrategy, DUMP_FOLDER, fieldPool, fields, implementationContextFactory, instrumentedMethods, instrumentedType, loadedTypeInitializer, methods, recordComponentPool, recordComponents, typeAttributeAppender, typeInitializer, typePool, typeValidation
Fields inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter
DUMP_PROPERTY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForCreation
(TypeDescription instrumentedType, ClassFileVersion classFileVersion, TypeWriter.FieldPool fieldPool, TypeWriter.MethodPool methodPool, TypeWriter.RecordComponentPool recordComponentPool, List<? extends DynamicType> auxiliaryTypes, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, MethodList<?> instrumentedMethods, RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, TypeAttributeAppender typeAttributeAppender, AsmVisitorWrapper asmVisitorWrapper, AnnotationValueFilter.Factory annotationValueFilterFactory, AnnotationRetention annotationRetention, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, TypeValidation typeValidation, ClassWriterStrategy classWriterStrategy, TypePool typePool) Creates a new default type writer for creating a new type that is not based on an existing class file. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeWriter.Default<U>.UnresolvedType
create
(TypeInitializer typeInitializer, TypeWriter.Default.ClassDumpAction.Dispatcher dispatcher) Creates an unresolved version of the dynamic type.wrap
(org.objectweb.asm.ClassVisitor classVisitor, int writerFlags, int readerFlags) Wraps another ASM class visitor with a visitor that represents this ASM class writer.Methods inherited from class net.bytebuddy.dynamic.scaffold.TypeWriter.Default
forCreation, forDecoration, forRebasing, forRedefinition, make
-
Field Details
-
methodPool
The method pool to use.
-
-
Constructor Details
-
ForCreation
protected ForCreation(TypeDescription instrumentedType, ClassFileVersion classFileVersion, TypeWriter.FieldPool fieldPool, TypeWriter.MethodPool methodPool, TypeWriter.RecordComponentPool recordComponentPool, List<? extends DynamicType> auxiliaryTypes, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, MethodList<?> instrumentedMethods, RecordComponentList<RecordComponentDescription.InDefinedShape> recordComponents, LoadedTypeInitializer loadedTypeInitializer, TypeInitializer typeInitializer, TypeAttributeAppender typeAttributeAppender, AsmVisitorWrapper asmVisitorWrapper, AnnotationValueFilter.Factory annotationValueFilterFactory, AnnotationRetention annotationRetention, AuxiliaryType.NamingStrategy auxiliaryTypeNamingStrategy, Implementation.Context.Factory implementationContextFactory, TypeValidation typeValidation, ClassWriterStrategy classWriterStrategy, TypePool typePool) Creates a new default type writer for creating a new type that is not based on an existing class file.- Parameters:
instrumentedType
- The instrumented type to be created.classFileVersion
- The class file version to write the instrumented type in and to apply when creating auxiliary types.fieldPool
- The field pool to use.methodPool
- The method pool to use.recordComponentPool
- The record component pool to use.auxiliaryTypes
- A list of auxiliary types to add to the created type.fields
- The instrumented type's declared fields.methods
- The instrumented type's declared and virtually inherited methods.instrumentedMethods
- The instrumented methods relevant to this type creation.recordComponents
- The instrumented type's record components.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.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.classWriterStrategy
- The class writer strategy to use.typePool
- The type pool to use for computing stack map frames, if required.
-
-
Method Details
-
wrap
public ContextClassVisitor wrap(org.objectweb.asm.ClassVisitor classVisitor, int writerFlags, int readerFlags) Wraps another ASM class visitor with a visitor that represents this ASM class writer.- Parameters:
classVisitor
- The class visitor to wrap.writerFlags
- The ASM writer flags to consider.readerFlags
- The ASM reader flags to consider.- Returns:
- The supplied class visitor wrapped by this type writer.
-
create
protected TypeWriter.Default<U>.UnresolvedType create(TypeInitializer typeInitializer, TypeWriter.Default.ClassDumpAction.Dispatcher dispatcher) Description copied from class:TypeWriter.Default
Creates an unresolved version of the dynamic type.- Specified by:
create
in classTypeWriter.Default<U>
- Parameters:
typeInitializer
- The type initializer to use.dispatcher
- A dispatcher for dumping class files.- Returns:
- An unresolved type.
-