Class TypeWriter.Default.ForInlining<U>
java.lang.Object
net.bytebuddy.dynamic.scaffold.TypeWriter.Default<U>
net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ForInlining<U>
- Type Parameters:
U- The best known loaded type for the dynamically created type.
- All Implemented Interfaces:
TypeWriter<U>
- Direct Known Subclasses:
TypeWriter.Default.ForInlining.WithDecorationOnly, TypeWriter.Default.ForInlining.WithFullProcessing
- Enclosing class:
TypeWriter.Default<S>
@Enhance
public abstract static class TypeWriter.Default.ForInlining<U>
extends TypeWriter.Default<U>
A type writer that inlines the created type into an existing class file.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA context registry allows to extract auxiliary types from a lazily created implementation context.protected classA context class visitor based on aTypeWriter.Default.ForInlining.ContextRegistry.protected static classA default type writer that only applies a type decoration.protected static classA default type writer that reprocesses a type completely.Nested classes/interfaces inherited from class TypeWriter.Default
TypeWriter.Default.ClassDumpAction, TypeWriter.Default.ForCreation<U>, TypeWriter.Default.ForInlining<U>, TypeWriter.Default.SignatureKey, TypeWriter.Default.UnresolvedType, TypeWriter.Default.ValidatingClassVisitorNested classes/interfaces inherited from interface TypeWriter
TypeWriter.Default<S>, TypeWriter.FieldPool, TypeWriter.MethodPool, TypeWriter.RecordComponentPool -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassFileLocatorThe class file locator for locating the original type's class file.protected final TypeDescriptionThe original type's description.Fields inherited from class TypeWriter.Default
annotationRetention, annotationValueFilterFactory, asmVisitorWrapper, auxiliaryTypeNamingStrategy, auxiliaryTypes, classFileVersion, classReaderFactory, classWriterFactory, DUMP_FOLDER, fieldPool, fields, implementationContextFactory, instrumentedMethods, instrumentedType, loadedTypeInitializer, methods, recordComponentPool, recordComponents, typeAttributeAppender, typeInitializer, typePool, typeValidationFields inherited from interface TypeWriter
DUMP_PROPERTY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForInlining(TypeDescription instrumentedType, ClassFileVersion classFileVersion, TypeWriter.FieldPool fieldPool, 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, AsmClassReader.Factory classReaderFactory, AsmClassWriter.Factory classWriterFactory, TypePool typePool, TypeDescription originalType, ClassFileLocator classFileLocator) Creates a new inlining type writer. -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeWriter.Default<U>.UnresolvedTypecreate(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.protected abstract org.objectweb.asm.ClassVisitorwriteTo(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, TypeWriter.Default.ForInlining.ContextRegistry contextRegistry, int writerFlags, int readerFlags) Creates a class visitor which weaves all changes and additions on the fly.Methods inherited from class TypeWriter.Default
forCreation, forDecoration, forRebasing, forRedefinition, make
-
Field Details
-
originalType
The original type's description. -
classFileLocator
The class file locator for locating the original type's class file.
-
-
Constructor Details
-
ForInlining
protected ForInlining(TypeDescription instrumentedType, ClassFileVersion classFileVersion, TypeWriter.FieldPool fieldPool, 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, AsmClassReader.Factory classReaderFactory, AsmClassWriter.Factory classWriterFactory, TypePool typePool, TypeDescription originalType, ClassFileLocator classFileLocator) Creates a new inlining type writer.- Parameters:
instrumentedType- The instrumented type to be created.classFileVersion- The class file specified by the user.fieldPool- The field pool to use.recordComponentPool- The record component pool to use.auxiliaryTypes- The explicit 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.classReaderFactory- The class reader factory to use.classWriterFactory- The class writer factory to use.typePool- The type pool to use for computing stack map frames, if required.originalType- The original type's description.classFileLocator- The class file locator for locating the original type's class file.
-
-
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.DefaultCreates an unresolved version of the dynamic type.- Specified by:
createin classTypeWriter.Default<U>- Parameters:
typeInitializer- The type initializer to use.dispatcher- A dispatcher for dumping class files.- Returns:
- An unresolved type.
-
writeTo
protected abstract org.objectweb.asm.ClassVisitor writeTo(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, TypeWriter.Default.ForInlining.ContextRegistry contextRegistry, int writerFlags, int readerFlags) Creates a class visitor which weaves all changes and additions on the fly.- Parameters:
classVisitor- The class visitor to which this entry is to be written to.typeInitializer- The type initializer to apply.contextRegistry- A context registry to register the lazily created implementation context to.writerFlags- The writer flags being used.readerFlags- The reader flags being used.- Returns:
- A class visitor which is capable of applying the changes.
-