Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.Chain.Step.ForInvocation
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForInvocation
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step
- Enclosing interface:
MemberSubstitution.Substitution.Chain.Step
@Enhance
public static class MemberSubstitution.Substitution.Chain.Step.ForInvocation
extends Object
implements MemberSubstitution.Substitution.Chain.Step
A step for invoking a method or constructor. If non-static, a method is invoked upon a the current stack argument of the chain.
Arguments are loaded from the intercepted byte code element with a possibility of substitution.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A factory to create a step for a method invocation.Nested classes/interfaces inherited from interface net.bytebuddy.asm.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 Assigner
The assigner to use.private final MethodDescription
The invoked method or constructor.A mapping of substituted parameter indices.private final Assigner.Typing
The typing to use when assigning. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForInvocation
(MethodDescription methodDescription, Map<Integer, Integer> substitutions, Assigner assigner, Assigner.Typing typing) Creates a new step of an invocation. -
Method Summary
Modifier and TypeMethodDescriptionresolve
(TypeDescription receiver, ByteCodeElement.Member original, 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
-
methodDescription
The invoked method or constructor. -
substitutions
A mapping of substituted parameter indices. For targets that are non-static methods, the targeted index is increased by one. -
assigner
The assigner to use. -
typing
The typing to use when assigning.
-
-
Constructor Details
-
ForInvocation
protected ForInvocation(MethodDescription methodDescription, Map<Integer, Integer> substitutions, Assigner assigner, Assigner.Typing typing) Creates a new step of an invocation.- Parameters:
methodDescription
- The invoked method or constructor.substitutions
- A mapping of substituted parameter indices. For targets that are non-static methods, the targeted index is increased by one.assigner
- The assigner to use.typing
- The typing to use when assigning.
-
-
Method Details
-
resolve
public MemberSubstitution.Substitution.Chain.Step.Resolution resolve(TypeDescription receiver, ByteCodeElement.Member original, 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:
resolve
in interfaceMemberSubstitution.Substitution.Chain.Step
- Parameters:
receiver
- The target result type of the substitution.original
- The byte code element that is currently substituted.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.
-