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<MemberSubstitution.Target>
- Enclosing interface:
- MemberSubstitution.Substitution.Chain.Step<U extends MemberSubstitution.Target>
@Enhance public static class MemberSubstitution.Substitution.Chain.Step.ForInvocation extends java.lang.Object implements MemberSubstitution.Substitution.Chain.Step<MemberSubstitution.Target>
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 Classes Modifier and Type Class Description static classMemberSubstitution.Substitution.Chain.Step.ForInvocation.FactoryA 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
Fields Modifier and Type Field Description private AssignerassignerThe assigner to use.private MethodDescriptionmethodDescriptionThe invoked method or constructor.private java.util.Map<java.lang.Integer,java.lang.Integer>substitutionsA mapping of substituted parameter indices.private Assigner.TypingtypingThe typing to use when assigning.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForInvocation(MethodDescription methodDescription, java.util.Map<java.lang.Integer,java.lang.Integer> substitutions, Assigner assigner, Assigner.Typing typing)Creates a new step of an invocation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MemberSubstitution.Substitution.Chain.Step.Resolutionresolve(MemberSubstitution.Target target, TypeList.Generic parameters, TypeDescription.Generic result, JavaConstant.MethodHandle methodHandle, StackManipulation stackManipulation, TypeDescription.Generic current, java.util.Map<java.lang.Integer,java.lang.Integer> offsets, int freeOffset)Resolves this step of a substitution chain.
-
-
-
Field Detail
-
methodDescription
private final MethodDescription methodDescription
The invoked method or constructor.
-
substitutions
private final java.util.Map<java.lang.Integer,java.lang.Integer> substitutions
A mapping of substituted parameter indices. For targets that are non-static methods, the targeted index is increased by one.
-
assigner
private final Assigner assigner
The assigner to use.
-
typing
private final Assigner.Typing typing
The typing to use when assigning.
-
-
Constructor Detail
-
ForInvocation
protected ForInvocation(MethodDescription methodDescription, java.util.Map<java.lang.Integer,java.lang.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 Detail
-
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, java.util.Map<java.lang.Integer,java.lang.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.
-
-