Class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForArgument
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForArgument
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
- Enclosing interface:
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
@Enhance
public static class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForArgument
extends Object
implements MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
An offset mapping that assigns an argument of either the instrumented
method or the substituted expression.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumA factory for creating an offset mapping for a parameter value of either the instrumented method or the substituted element.protected static classA resolved offset mapping to the parameter of either the instrumented method or the substituted element.Nested classes/interfaces inherited from interface MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForAllArguments, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForArgument, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForCurrent, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForDynamicConstant, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForField, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForFieldHandle, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForHandle, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForOrigin, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForSelfCallHandle, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStubValue, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForThisReference -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe index of the parameter.private final booleantrueifnullor a primitive0should be assigned to the parameter if the provided index is not available.private final MemberSubstitution.SourceThe source providing the argument.private final TypeDescription.GenericA description of the targeted type.private final Assigner.TypingThe typing to use ornullif the global typing setting should be applied. -
Constructor Summary
ConstructorsConstructorDescriptionForArgument(TypeDescription.Generic targetType, int index, Assigner.Typing typing, MemberSubstitution.Source source, boolean optional) Creates a new offset mapping for an argument to either the substituted expression or the instrumented method. -
Method Summary
Modifier and TypeMethodDescriptionresolve(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves an offset mapping for a given instrumented method.
-
Field Details
-
targetType
A description of the targeted type. -
index
private final int indexThe index of the parameter. -
typing
The typing to use ornullif the global typing setting should be applied. -
source
The source providing the argument. -
optional
private final boolean optionaltrueifnullor a primitive0should be assigned to the parameter if the provided index is not available.
-
-
Constructor Details
-
ForArgument
public ForArgument(TypeDescription.Generic targetType, int index, @MaybeNull Assigner.Typing typing, MemberSubstitution.Source source, boolean optional) Creates a new offset mapping for an argument to either the substituted expression or the instrumented method.- Parameters:
targetType- A description of the targeted type.index- The index of the parameter.typing- The typing to use ornullif the global typing setting should be applied.source- The source providing the argument.optional-trueifnullor a primitive0should be assigned to the parameter if the provided index is not available.
-
-
Method Details
-
resolve
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Resolved resolve(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves an offset mapping for a given instrumented method.- Specified by:
resolvein interfaceMemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping- Parameters:
assigner- The assigner to use.typing- The typing to use if no explicit typing is specified.instrumentedType- The instrumented type.instrumentedMethod- The instrumented method.- Returns:
- A resolved version of this offset mapping.
-