Package net.bytebuddy.asm
Class MemberSubstitution.Replacement.ForFirstBinding
- java.lang.Object
-
- net.bytebuddy.asm.MemberSubstitution.Replacement.ForFirstBinding
-
- All Implemented Interfaces:
MemberSubstitution.Replacement
- Enclosing interface:
- MemberSubstitution.Replacement
@Enhance public static class MemberSubstitution.Replacement.ForFirstBinding extends java.lang.Object implements MemberSubstitution.Replacement
A replacement that only resolves the first matching replacement of a list of replacements.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Replacement
MemberSubstitution.Replacement.Binding, MemberSubstitution.Replacement.Factory, MemberSubstitution.Replacement.ForElementMatchers, MemberSubstitution.Replacement.ForFirstBinding, MemberSubstitution.Replacement.InvocationType, MemberSubstitution.Replacement.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<? extends MemberSubstitution.Replacement>
replacements
The list of replacements to consider.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForFirstBinding(java.util.List<? extends MemberSubstitution.Replacement> replacements)
Creates a new replacement that triggers the first matching replacement, if any.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MemberSubstitution.Replacement.Binding
bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, FieldDescription.InDefinedShape fieldDescription, boolean writeAccess)
Binds this replacement for a field that was discovered.MemberSubstitution.Replacement.Binding
bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, MethodDescription methodDescription, MemberSubstitution.Replacement.InvocationType invocationType)
Binds this replacement for a field that was discovered.
-
-
-
Field Detail
-
replacements
private final java.util.List<? extends MemberSubstitution.Replacement> replacements
The list of replacements to consider.
-
-
Constructor Detail
-
ForFirstBinding
protected ForFirstBinding(java.util.List<? extends MemberSubstitution.Replacement> replacements)
Creates a new replacement that triggers the first matching replacement, if any.- Parameters:
replacements
- The list of replacements to consider.
-
-
Method Detail
-
bind
public MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, FieldDescription.InDefinedShape fieldDescription, boolean writeAccess)
Binds this replacement for a field that was discovered.- Specified by:
bind
in interfaceMemberSubstitution.Replacement
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.fieldDescription
- The field that was discovered.writeAccess
-true
if this field was written to.- Returns:
- A binding for the discovered field access.
-
bind
public MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, MethodDescription methodDescription, MemberSubstitution.Replacement.InvocationType invocationType)
Binds this replacement for a field that was discovered.- Specified by:
bind
in interfaceMemberSubstitution.Replacement
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typeDescription
- The type on which the method was invoked.methodDescription
- The method that was discovered.invocationType
- The invocation type for this method.- Returns:
- A binding for the discovered method invocation.
-
-