Class ByteCodeAppender.Simple
java.lang.Object
net.bytebuddy.implementation.bytecode.ByteCodeAppender.Simple
- All Implemented Interfaces:
ByteCodeAppender
- Enclosing interface:
ByteCodeAppender
A simple byte code appender that only represents a given array of
StackManipulations.-
Nested Class Summary
Nested classes/interfaces inherited from interface ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StackManipulationA compound stack manipulation to be applied for this byte code appender. -
Constructor Summary
ConstructorsConstructorDescriptionSimple(List<? extends StackManipulation> stackManipulations) Creates a new simple byte code appender which represents the given stack manipulation.Simple(StackManipulation... stackManipulation) Creates a new simple byte code appender which represents the given stack manipulation. -
Method Summary
Modifier and TypeMethodDescriptionapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Applies this byte code appender to a type creation process.
-
Field Details
-
stackManipulation
A compound stack manipulation to be applied for this byte code appender.
-
-
Constructor Details
-
Simple
Creates a new simple byte code appender which represents the given stack manipulation.- Parameters:
stackManipulation- The stack manipulations to apply for this byte code appender in their application order.
-
Simple
Creates a new simple byte code appender which represents the given stack manipulation.- Parameters:
stackManipulations- The stack manipulations to apply for this byte code appender in their application order.
-
-
Method Details
-
apply
public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod) Applies this byte code appender to a type creation process.- Specified by:
applyin interfaceByteCodeAppender- Parameters:
methodVisitor- The method visitor to which the byte code appender writes its code to.implementationContext- The implementation context of the current type creation process.instrumentedMethod- The method that is the target of the instrumentation.- Returns:
- The required size for the applied byte code to run.
-