Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForThisReference
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForThisReference
- 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.ForThisReference
extends Object
implements MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping
An offset mapping that assigns the
this
reference.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enum
A factory for creating an offset mapping for binding aMemberSubstitution.This
reference.protected static class
A resolved offset mapping for resolving thethis
reference.Nested classes/interfaces inherited from interface net.bytebuddy.asm.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.ForField, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForFieldHandle, 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 boolean
true
ifnull
or a primitive0
should be assigned to the parameter if nothis
reference is available.private final MemberSubstitution.Source
The source providing the reference.private final TypeDescription.Generic
The targeted type.private final Assigner.Typing
The typing to use ornull
if implicit typing. -
Constructor Summary
ConstructorsConstructorDescriptionForThisReference
(TypeDescription.Generic targetType, Assigner.Typing typing, MemberSubstitution.Source source, boolean optional) Creates an offset mapping that resolves thethis
reference. -
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
The targeted type. -
typing
The typing to use ornull
if implicit typing. -
source
The source providing the reference. -
optional
private final boolean optionaltrue
ifnull
or a primitive0
should be assigned to the parameter if nothis
reference is available.
-
-
Constructor Details
-
ForThisReference
public ForThisReference(TypeDescription.Generic targetType, @MaybeNull Assigner.Typing typing, MemberSubstitution.Source source, boolean optional) Creates an offset mapping that resolves thethis
reference.- Parameters:
targetType
- The targeted type.typing
- The typing to use ornull
if implicit typing.source
- The source providing the reference.optional
-true
ifnull
or a primitive0
should be assigned to the parameter if nothis
reference is available.
-
-
Method Details
-
resolve
public MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForThisReference.Resolved resolve(Assigner assigner, Assigner.Typing typing, TypeDescription instrumentedType, MethodDescription instrumentedMethod) Resolves an offset mapping for a given instrumented method.- Specified by:
resolve
in 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.
-