Top Description Fields Constructors Methods
tools.jackson.module.afterburner.util.bytebuddy

public Class UsingIfStackManipulation<T>

extends AbstractPropertyStackManipulation
Class Inheritance
Imports
net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.bytecode.StackManipulation, net.bytebuddy.implementation.bytecode.constant.IntegerConstant, net.bytebuddy.jar.asm.Label, .MethodVisitor, java.util.ArrayList, .List

Provides template for a method that invokes an operation on a bean. The method or field that the operation is performed on is chosen by the supplied index and the resulting bytecode uses jump to simulate if/then/else statements The invocation on the bean is configurable via a SinglePropStackManipulationSupplier One possible bytecode outcome would be:
if (var2 == 0) {
     varX.setA(var3);
 } else if (var2 == 1) {
     varX.setB(var3);
 } else {
     varX.setC(var3);
 }

Another possible bytecode outcome this class could produce would be:
if (var2 == 0) {
     return varX.getA();
 } else if (var2 == 1) {
     return varX.getB();
 } else {
     return varX.getC();
 }

Field Summary

Modifier and TypeField and Description
private final List<T>
private final SinglePropStackManipulationSupplier<T>
Inherited from tools.jackson.module.afterburner.util.bytebuddy.AbstractPropertyStackManipulation:
localVarIndexCalculator

Constructor Summary

AccessConstructor and Description
public
UsingIfStackManipulation(AbstractPropertyStackManipulation.LocalVarIndexCalculator localVarIndexCalculator, List<T> props, SinglePropStackManipulationSupplier<T> singlePropStackManipulationSupplier, boolean isForMutator)

Method Summary

Modifier and TypeMethod and Description
public StackManipulation.Size
apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Inherited from tools.jackson.module.afterburner.util.bytebuddy.AbstractPropertyStackManipulation:
beanArgIndexfieldIndexArgIndexisValidloadFieldIndexArglocalVarIndex

Field Detail

propsback to summary
private final List<T> props
singlePropStackManipulationSupplierback to summary
private final SinglePropStackManipulationSupplier<T> singlePropStackManipulationSupplier

Constructor Detail

UsingIfStackManipulationback to summary
public UsingIfStackManipulation(AbstractPropertyStackManipulation.LocalVarIndexCalculator localVarIndexCalculator, List<T> props, SinglePropStackManipulationSupplier<T> singlePropStackManipulationSupplier, boolean isForMutator)

Method Detail

applyback to summary
public StackManipulation.Size apply(MethodVisitor methodVisitor, Implementation.Context implementationContext)

Implements net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Doc from net.bytebuddy.implementation.bytecode.StackManipulation.apply.

Applies the stack manipulation that is described by this instance.

Annotations
@Override