net.bytebuddy.jar.asm.MethodVisitor
.
The
ByteCodeAppender
is not allowed to write
annotations to the method or call the net.bytebuddy.jar.asm.MethodVisitor#visitCode()
,
net.bytebuddy.jar.asm.MethodVisitor#visitMaxs(int, int)
or net.bytebuddy.jar.asm.MethodVisitor#visitEnd()
methods which is both done by the entity delegating the call to the ByteCodeAppender
. This is done in order
to allow for the concatenation of several byte code appenders and therefore a more modular description of method
implementations.
Modifier and Type | Class and Description |
---|---|
public static class | ByteCodeAppender.Compound
A compound appender that combines a given number of other byte code appenders. |
public static class | ByteCodeAppender.Simple
A simple byte code appender that only represents a given array of
|
public static class | ByteCodeAppender.Size
An immutable description of both the operand stack size and the size of the local variable array that is
required to run the code generated by this |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender. | Returns: The required size for the applied byte code to run.The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Applies this byte code appender to a type creation process. |
apply | back to summary |
---|---|
public ByteCodeAppender. Applies this byte code appender to a type creation process.
|
Modifier and Type | Field and Description |
---|---|
private final List | byteCodeAppenders
The byte code appenders that are represented by this compound appender in their application order. |
Access | Constructor and Description |
---|---|
public | Compound(ByteCodeAppender...
The byte code appenders to combine in their order. byteCodeAppender)Creates a new compound byte code appender. |
public | Compound(List<? extends ByteCodeAppender>
The byte code appenders to combine in their order. byteCodeAppenders)Creates a new compound byte code appender. |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender. | apply(MethodVisitor
The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Implements net. |
byteCodeAppenders | back to summary |
---|---|
private final List<ByteCodeAppender> byteCodeAppenders The byte code appenders that are represented by this compound appender in their application order. |
Compound | back to summary |
---|---|
public Compound(ByteCodeAppender... byteCodeAppender) Creates a new compound byte code appender.
|
Compound | back to summary |
---|---|
public Compound(List<? extends ByteCodeAppender> byteCodeAppenders) Creates a new compound byte code appender.
|
apply | back to summary |
---|---|
public ByteCodeAppender. Implements net. Doc from net. Applies this byte code appender to a type creation process.
|
StackManipulation
s.
Modifier and Type | Field and Description |
---|---|
private final StackManipulation | stackManipulation
A compound stack manipulation to be applied for this byte code appender. |
Access | Constructor and Description |
---|---|
public | Simple(StackManipulation...
The stack manipulations to apply for this byte code appender in their application order. stackManipulation)Creates a new simple byte code appender which represents the given stack manipulation. |
public | Simple(List<? extends StackManipulation>
The stack manipulations to apply for this byte code appender in their application order. stackManipulations)Creates a new simple byte code appender which represents the given stack manipulation. |
Modifier and Type | Method and Description |
---|---|
public ByteCodeAppender. | apply(MethodVisitor
The method visitor to which the byte code appender writes its code to. methodVisitor, Implementation.The implementation context of the current type creation process. implementationContext,The method that is the target of the instrumentation. instrumentedMethod)Implements net. |
stackManipulation | back to summary |
---|---|
private final StackManipulation stackManipulation A compound stack manipulation to be applied for this byte code appender. |
Simple | back to summary |
---|---|
public Simple(StackManipulation... stackManipulation) Creates a new simple byte code appender which represents the given stack manipulation.
|
Simple | back to summary |
---|---|
public Simple(List<? extends StackManipulation> stackManipulations) Creates a new simple byte code appender which represents the given stack manipulation.
|
apply | back to summary |
---|---|
public ByteCodeAppender. Implements net. Doc from net. Applies this byte code appender to a type creation process.
|
ByteCodeAppender
.
Modifier and Type | Field and Description |
---|---|
private final int | localVariableSize
The size of the local variable array. |
private final int | operandStackSize
The size of the operand stack. |
public static final ByteCodeAppender. | ZERO
A size of zero. |
Access | Constructor and Description |
---|---|
public | Size(int
The operand stack size that is required for running given byte code. operandStackSize, int The local variable array size that is required for running given byte code. localVariableSize)
|
Modifier and Type | Method and Description |
---|---|
public int | Returns: The required size of the local variable array.Returns the required size of the local variable array. |
public int | Returns: The required operand stack size.Returns the required operand stack size. |
public ByteCodeAppender. | Returns: A size description incorporating both size requirements.The other size description. otherMerges two sizes in order to describe the size that is required by both size descriptions. |
localVariableSize | back to summary |
---|---|
private final int localVariableSize The size of the local variable array. |
operandStackSize | back to summary |
---|---|
private final int operandStackSize The size of the operand stack. |
ZERO | back to summary |
---|---|
public static final ByteCodeAppender. A size of zero. |
Size | back to summary |
---|---|
public Size(int operandStackSize, int localVariableSize)
|
getLocalVariableSize | back to summary |
---|---|
public int getLocalVariableSize() Returns the required size of the local variable array.
|
getOperandStackSize | back to summary |
---|---|
public int getOperandStackSize() Returns the required operand stack size.
|
merge | back to summary |
---|---|
public ByteCodeAppender. Merges two sizes in order to describe the size that is required by both size descriptions.
|