Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending
- java.lang.Object
-
- org.objectweb.asm.MethodVisitor
-
- net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor
-
- 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 ExceptionTableSensitiveMethodVisitor implements TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler, TypeInitializer.Drain
An initialization handler that appends code to a previously visited type initializer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceTypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriterA frame writer is responsible for adding empty frames on jump instructions.protected static classTypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrainAn initialization handler that appends code to a previously visited type initializer with allowing activeTypeInitializerregistrations.protected static classTypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithoutDrainAn initialization handler that appends code to a previously visited type initializer without allowing activeTypeInitializerregistrations.-
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
Fields Modifier and Type Field Description protected AnnotationValueFilter.FactoryannotationValueFilterFactoryThe used annotation value filter factory.protected TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriterframeWriterThe frame writer to use.protected TypeDescriptioninstrumentedTypeThe instrumented type.protected intlocalVariableLengthThe currently recorded local variable length.protected TypeWriter.MethodPool.RecordrecordThe method pool record for the type initializer.protected intstackSizeThe currently recorded stack size.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAppending(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
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidapply(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext)Applies the drain.voidcomplete(org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context.ExtractableView implementationContext)Invoked upon completion of writing the instrumented type.protected static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandlerof(boolean enabled, org.objectweb.asm.MethodVisitor methodVisitor, TypeDescription instrumentedType, TypeWriter.MethodPool methodPool, AnnotationValueFilter.Factory annotationValueFilterFactory, boolean requireFrames, boolean expandFrames)Resolves an initialization handler.protected voidonAfterExceptionTable()Invoked after the exception table was visited.protected abstract voidonComplete(Implementation.Context implementationContext)Invoked upon completion of writing the type initializer.protected abstract voidonStart()Invoked after the user code was visited.protected voidonVisitFrame(int type, int localVariableLength, java.lang.Object[] localVariable, int stackSize, java.lang.Object[] stack)Visits a stack map frame.voidvisitCode()abstract voidvisitEnd()voidvisitMaxs(int stackSize, int localVariableLength)private static TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.WithDrainwithDrain(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.WithoutDrainwithoutDrain(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 net.bytebuddy.utility.visitor.ExceptionTableSensitiveMethodVisitor
onVisitFieldInsn, onVisitIincInsn, onVisitInsn, onVisitIntInsn, onVisitInvokeDynamicInsn, onVisitJumpInsn, onVisitLabel, onVisitLdcInsn, onVisitLookupSwitchInsn, onVisitMethodInsn, onVisitMethodInsn, onVisitMultiANewArrayInsn, onVisitTableSwitchInsn, onVisitTypeInsn, onVisitVarInsn, visitFieldInsn, visitFrame, visitIincInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLookupSwitchInsn, visitMethodInsn, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTypeInsn, visitVarInsn
-
Methods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitInsnAnnotation, visitLineNumber, visitLocalVariable, visitLocalVariableAnnotation, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTryCatchBlock, visitTypeAnnotation
-
-
-
-
Field Detail
-
instrumentedType
protected final TypeDescription instrumentedType
The instrumented type.
-
record
protected final TypeWriter.MethodPool.Record record
The method pool record for the type initializer.
-
annotationValueFilterFactory
protected final AnnotationValueFilter.Factory annotationValueFilterFactory
The used annotation value filter factory.
-
frameWriter
protected final TypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler.Appending.FrameWriter frameWriter
The frame writer to use.
-
stackSize
protected int stackSize
The currently recorded stack size.
-
localVariableLength
protected int localVariableLength
The currently recorded local variable length.
-
-
Constructor Detail
-
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-trueif the visitor is required to add frames.expandFrames-trueif the visitor is required to expand any added frame.
-
-
Method Detail
-
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-trueif the implementation context is enabled, i.e. anyTypeInitializermight 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-trueif frames must be computed.expandFrames-trueif 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-trueif frames must be computed.expandFrames-trueif 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-trueif frames must be computed.expandFrames-trueif frames must be expanded.- Returns:
- An initialization handler which is also guaranteed to be a
MethodVisitor.
-
visitCode
public void visitCode()
- Overrides:
visitCodein classorg.objectweb.asm.MethodVisitor
-
onAfterExceptionTable
protected void onAfterExceptionTable()
Description copied from class:ExceptionTableSensitiveMethodVisitorInvoked after the exception table was visited. Typically, the exception table is visited by ASM at the beginning of a method. It is however possible that a user adds exception table entries at a later point. Normally, this is however not meaningful use of ASM.- Specified by:
onAfterExceptionTablein classExceptionTableSensitiveMethodVisitor
-
onStart
protected abstract void onStart()
Invoked after the user code was visited.
-
onVisitFrame
protected void onVisitFrame(int type, int localVariableLength, @MaybeNull java.lang.Object[] localVariable, int stackSize, @MaybeNull java.lang.Object[] stack)Description copied from class:ExceptionTableSensitiveMethodVisitorVisits a stack map frame.- Overrides:
onVisitFramein classExceptionTableSensitiveMethodVisitor- Parameters:
type- The type of stack map frame.localVariableLength- The length of the local variable array.localVariable- An array containing type symbols for all values in the local variable array ornullif none.stackSize- The size of the operand stack.stack- An array containing type symbols for all values on the operand stack ornullif none.
-
visitMaxs
public void visitMaxs(int stackSize, int localVariableLength)- Overrides:
visitMaxsin classorg.objectweb.asm.MethodVisitor
-
visitEnd
public abstract void visitEnd()
- Overrides:
visitEndin classorg.objectweb.asm.MethodVisitor
-
apply
public void apply(org.objectweb.asm.ClassVisitor classVisitor, TypeInitializer typeInitializer, Implementation.Context implementationContext)Applies the drain.- Specified by:
applyin interfaceTypeInitializer.Drain- Parameters:
classVisitor- The class visitor to apply the initializer to.typeInitializer- The type initializer to write.implementationContext- The corresponding implementation context.
-
onComplete
protected abstract void onComplete(Implementation.Context implementationContext)
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:
completein interfaceTypeWriter.Default.ForInlining.WithFullProcessing.InitializationHandler- Parameters:
classVisitor- The class visitor to write any methods to.implementationContext- The implementation context to use.
-
-