Class MemberSubstitution.Substitution.Chain.Step.ForArgumentLoading
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForArgumentLoading
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target>, MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target>
- Enclosing interface:
MemberSubstitution.Substitution.Chain.Step<U extends MemberSubstitution.Target>
@Enhance
public static class MemberSubstitution.Substitution.Chain.Step.ForArgumentLoading
extends Object
implements MemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target>, MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target>
A step that loads an argument to a method as the current chain value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classA factory that resolves a given argument of the instrumented method.protected static enumA factory that resolves thethisreference of the instrumented method.Nested classes/interfaces inherited from interface MemberSubstitution.Substitution.Chain.Step
MemberSubstitution.Substitution.Chain.Step.Factory<V>, 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 intThe index of the argument to substitute. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedForArgumentLoading(int index) Creates an argument loading step. -
Method Summary
Modifier and TypeMethodDescriptionmake(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Creates a substitution step for an instrumented method.ofInstrumentedMethod(int index) Creates a factory that loads the argument for the instrumented method's parameter of the specified index.ofTarget(int index) Creates a factory that loads the argument for the targeted value's parameter of the specified index.ofThis()Creates a factory that loads thethisreference of the instrumented method.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
-
index
private final int indexThe index of the argument to substitute.
-
-
Constructor Details
-
ForArgumentLoading
protected ForArgumentLoading(int index) Creates an argument loading step.- Parameters:
index- The index of the argument to load.
-
-
Method Details
-
ofTarget
public static MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> ofTarget(int index) Creates a factory that loads the argument for the targeted value's parameter of the specified index.- Parameters:
index- The index to load.- Returns:
- An appropriate factory.
-
ofInstrumentedMethod
public static MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> ofInstrumentedMethod(int index) Creates a factory that loads the argument for the instrumented method's parameter of the specified index.- Parameters:
index- The index to load.- Returns:
- An appropriate factory.
-
ofThis
public static MemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target> ofThis()Creates a factory that loads thethisreference of the instrumented method.- Returns:
- An appropriate factory.
-
make
public MemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target> make(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Creates a substitution step for an instrumented method.- Specified by:
makein interfaceMemberSubstitution.Substitution.Chain.Step.Factory<MemberSubstitution.Target>- Parameters:
assigner- The assigner to use.typing- The typing to use.instrumentedType- The instrumented type.instrumentedMethod- The instrumented method.- Returns:
- The substitution step to apply.
-
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.
-