Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending
java.lang.Object
org.objectweb.asm.MethodVisitor
net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending
- All Implemented Interfaces:
TypeInitializer.Drain
,TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler
- Direct Known Subclasses:
TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain
,TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain
- Enclosing interface:
- TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler
public abstract static class TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending
extends org.objectweb.asm.MethodVisitor
implements TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler, TypeInitializer.Drain
An initialization handler that appends code to a previously visited type initializer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A frame writer is responsible for adding empty frames on jump instructions.protected static class
An initialization handler that appends code to a previously visited type initializer with allowing activeTypeInitializer
registrations.protected static class
An initialization handler that appends code to a previously visited type initializer without allowing activeTypeInitializer
registrations.Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeInitializer.Drain
TypeInitializer.Drain.Default
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler
TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending, TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Creating
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotationValueFilter.Factory
The used annotation value filter factory.protected final TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter
The frame writer to use.protected final TypeDescription
The instrumented type.protected int
The currently recorded local variable length.protected final TypeWriter.MethodPool.Record
The method pool record for the type initializer.protected int
The currently recorded stack size.Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Appending
(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool.Record record, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Creates a new appending initialization handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext) Applies the drain.void
complete
(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context.ExtractableView implementationContext) Invoked upon completion of writing the instrumented type.of
(boolean enabled, org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Resolves an initialization handler.protected abstract void
onComplete
(Implementation.Context implementationContext) Invoked upon completion of writing the type initializer.protected abstract void
onStart()
Invoked after the user code was visited.void
abstract void
visitEnd()
void
visitFrame
(int type, int localVariableLength, Object[] localVariable, int stackSize, Object[] stack) void
visitMaxs
(int stackSize, int localVariableLength) private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain
withDrain
(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Resolves an initialization handler with a drain.private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain
withoutDrain
(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Resolves an initialization handler without a drain.Methods inherited from class org.objectweb.asm.MethodVisitor
visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitFieldInsn, visitIincInsn, visitInsn, visitInsnAnnotation, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitParameter, visitParameterAnnotation, visitTableSwitchInsn, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation, visitTypeInsn, visitVarInsn
-
Field Details
-
instrumentedType
The instrumented type. -
record
The method pool record for the type initializer. -
annotationValueFilterFactory
The used annotation value filter factory. -
frameWriter
protected final TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter frameWriterThe frame writer to use. -
stackSize
protected int stackSizeThe currently recorded stack size. -
localVariableLength
protected int localVariableLengthThe currently recorded local variable length.
-
-
Constructor Details
-
Appending
protected Appending(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool.Record record, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Creates a new appending initialization handler.- Parameters:
methodVisitor
- The underlying method visitor.instrumentedType
- The instrumented type.record
- The method pool record for the type initializer.annotationValueFilterFactory
- The used annotation value filter factory.requireFrames
-true
if the visitor is required to add frames.expandFrames
-true
if the visitor is required to expand any added frame.
-
-
Method Details
-
of
protected static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler of(boolean enabled, org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Resolves an initialization handler.- Parameters:
enabled
-true
if the implementation context is enabled, i.e. anyTypeInitializer
might be active.methodVisitor
- The delegation method visitor.instrumentedType
- The instrumented type.methodPool
- The method pool to use.annotationValueFilterFactory
- The annotation value filter factory to use.requireFrames
-true
if frames must be computed.expandFrames
-true
if frames must be expanded.- Returns:
- An initialization handler which is also guaranteed to be a
MethodVisitor
.
-
withDrain
private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrain withDrain(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Resolves an initialization handler with a drain.- Parameters:
methodVisitor
- The delegation method visitor.instrumentedType
- The instrumented type.methodPool
- The method pool to use.annotationValueFilterFactory
- The annotation value filter factory to use.requireFrames
-true
if frames must be computed.expandFrames
-true
if frames must be expanded.- Returns:
- An initialization handler which is also guaranteed to be a
MethodVisitor
.
-
withoutDrain
private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrain withoutDrain(org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames) Resolves an initialization handler without a drain.- Parameters:
methodVisitor
- The delegation method visitor.instrumentedType
- The instrumented type.methodPool
- The method pool to use.annotationValueFilterFactory
- The annotation value filter factory to use.requireFrames
-true
if frames must be computed.expandFrames
-true
if frames must be expanded.- Returns:
- An initialization handler which is also guaranteed to be a
MethodVisitor
.
-
visitCode
public void visitCode()- Overrides:
visitCode
in classorg.objectweb.asm.MethodVisitor
-
onStart
protected abstract void onStart()Invoked after the user code was visited. -
visitFrame
public void visitFrame(int type, int localVariableLength, @MaybeNull Object[] localVariable, int stackSize, @MaybeNull Object[] stack) - Overrides:
visitFrame
in classorg.objectweb.asm.MethodVisitor
-
visitMaxs
public void visitMaxs(int stackSize, int localVariableLength) - Overrides:
visitMaxs
in classorg.objectweb.asm.MethodVisitor
-
visitEnd
public abstract void visitEnd()- Overrides:
visitEnd
in classorg.objectweb.asm.MethodVisitor
-
apply
public void apply(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext) Applies the drain.- Specified by:
apply
in interfaceTypeInitializer.Drain
- Parameters:
classVisitor
- The class visitor to apply the initializer to.typeInitializer
- The type initializer to write.implementationContext
- The corresponding implementation context.
-
onComplete
Invoked upon completion of writing the type initializer.- Parameters:
implementationContext
- The implementation context to use.
-
complete
public void complete(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context.ExtractableView implementationContext) Invoked upon completion of writing the instrumented type.- Specified by:
complete
in interfaceTypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler
- Parameters:
classVisitor
- The class visitor to write any methods to.implementationContext
- The implementation context to use.
-