Class ByteCodeAppender.Simple
- java.lang.Object
-
- net.bytebuddy.implementation.bytecode.ByteCodeAppender.Simple
-
- All Implemented Interfaces:
ByteCodeAppender
- Enclosing interface:
- ByteCodeAppender
@Enhance public static class ByteCodeAppender.Simple extends java.lang.Object implements ByteCodeAppender
A simple byte code appender that only represents a given array ofStackManipulations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bytecode.ByteCodeAppender
ByteCodeAppender.Compound, ByteCodeAppender.Simple, ByteCodeAppender.Size
-
-
Field Summary
Fields Modifier and Type Field Description private StackManipulationstackManipulationA compound stack manipulation to be applied for this byte code appender.
-
Constructor Summary
Constructors Constructor Description Simple(java.util.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppender.Sizeapply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)Applies this byte code appender to a type creation process.
-
-
-
Field Detail
-
stackManipulation
private final StackManipulation stackManipulation
A compound stack manipulation to be applied for this byte code appender.
-
-
Constructor Detail
-
Simple
public Simple(StackManipulation... stackManipulation)
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
public Simple(java.util.List<? extends StackManipulation> stackManipulations)
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 Detail
-
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.
-
-