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

public Class UsingSwitchStackManipulation<T>

extends AbstractPropertyStackManipulation
Class Inheritance
Imports
net.bytebuddy.implementation.Implementation, net.bytebuddy.implementation.bytecode.StackManipulation, 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 tableswitch to simulate a switch statement The invocation on the bean is configurable via a SinglePropStackManipulationSupplier One possible bytecode outcome would be:
switch(var2) {
  case 0:
     var4.setC(var3);
     return;
  case 1:
     var4.setA(var3);
     return;
  case 2:
     var4.setB(var3);
     return;
  case 3:
     var4.setE(var3);
     return;
  default:
}

Another possible bytecode outcome this class could produce would be:
switch(var2) {
  case 0:
     return var4.getA();
  case 1:
     return var4.getB();
  case 2:
     return var4.getC();
  case 3:
     return var4.getD();
  default:
}

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
UsingSwitchStackManipulation(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

UsingSwitchStackManipulationback to summary
public UsingSwitchStackManipulation(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