Class MemberSubstitution.Substitution.Chain.Step.ForArgumentSubstitution
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForArgumentSubstitution
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target>
- Enclosing interface:
MemberSubstitution.Substitution.Chain.Step<U extends MemberSubstitution.Target>
@Enhance
public static class MemberSubstitution.Substitution.Chain.Step.ForArgumentSubstitution
extends Object
implements MemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target>
A step that substitutes an argument of a given index with a compatible type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA factory to create an argument substitution step.Nested classes/interfaces inherited from interface MemberSubstitution.Substitution.Chain.Step
MemberSubstitution.Substitution.Chain.Step.ForArgumentLoading, MemberSubstitution.Substitution.Chain.Step.ForArgumentSubstitution, MemberSubstitution.Substitution.Chain.Step.ForAssignment, MemberSubstitution.Substitution.Chain.Step.ForDelegation, MemberSubstitution.Substitution.Chain.Step.ForField, MemberSubstitution.Substitution.Chain.Step.ForInvocation, MemberSubstitution.Substitution.Chain.Step.OfOriginalExpression, MemberSubstitution.Substitution.Chain.Step.Resolution, MemberSubstitution.Substitution.Chain.Step.Simple -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AssignerThe assigner to use for assigning the argument.private final intThe index of the argument to substitute.private final StackManipulationThe stack manipulation that loads the substituted argument.private final TypeDescription.GenericThe type of the substituted argument.private final Assigner.TypingThe typing to use for the argument assignment. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForArgumentSubstitution(StackManipulation substitution, TypeDescription.Generic typeDescription, int index, Assigner assigner, Assigner.Typing typing) Creates an argument substitution step. -
Method Summary
Modifier and TypeMethodDescriptionResolves a step substitution factory for a compile-time constant to replace an argument value at a given index.resolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, TypeDescription.Generic current, Map<Integer, Integer> offsets, int freeOffset) Resolves this step of a substitution chain.
-
Field Details
-
substitution
The stack manipulation that loads the substituted argument. -
typeDescription
The type of the substituted argument. -
index
private final int indexThe index of the argument to substitute. -
assigner
The assigner to use for assigning the argument. -
typing
The typing to use for the argument assignment.
-
-
Constructor Details
-
ForArgumentSubstitution
protected ForArgumentSubstitution(StackManipulation substitution, TypeDescription.Generic typeDescription, int index, Assigner assigner, Assigner.Typing typing) Creates an argument substitution step.- Parameters:
substitution- The stack manipulation that loads the substituted argument.typeDescription- The type of the substituted argument.index- The index of the argument to substitute.assigner- The assigner to use for assigning the argument.typing- The typing to use for the argument assignment.
-
-
Method Details
-
of
public static MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> of(Object value, int index) Resolves a step substitution factory for a compile-time constant to replace an argument value at a given index.- Parameters:
value- The compile-time constant to replace.index- The index of the substituted argument.- Returns:
- An appropriate step factory.
-
resolve
public MemberSubstitution.Substitution.Chain.Step.Resolution resolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, TypeDescription.Generic current, Map<Integer, Integer> offsets, int freeOffset) Resolves this step of a substitution chain.- Specified by:
resolvein interfaceMemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target>- Parameters:
target- The target member of invokedynamic invocation.parameters- The parameters of the substituted element.result- The resulting type of the substituted element.methodHandle- A method handle of the stackManipulation invocation that is being substituted.stackManipulation- The byte code instruction that is being substituted.current- The current type of the applied substitution that is the top element on the operand stack.offsets- The arguments of the substituted byte code element mapped to their local variable offsets.freeOffset- The first free offset in the local variable array.- Returns:
- A resolved substitution step for the supplied inputs.
-