Package net.bytebuddy.asm
Interface MemberSubstitution.Replacement
-
- All Known Implementing Classes:
MemberSubstitution.Replacement.ForDynamicInvocation,MemberSubstitution.Replacement.ForElementMatchers,MemberSubstitution.Replacement.ForFirstBinding,MemberSubstitution.Replacement.NoOp
- Enclosing class:
- MemberSubstitution
protected static interface MemberSubstitution.ReplacementA replacement combines aMemberSubstitution.Substitutionand a way of choosing if this substitution should be applied for a discovered member.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMemberSubstitution.Replacement.BindingA binding for a replacement of a field or method access within another method.static interfaceMemberSubstitution.Replacement.FactoryA factory for creating a replacement for an instrumented method.static classMemberSubstitution.Replacement.ForDynamicInvocationA replacement that substitutes a invokedynamic instruction.static classMemberSubstitution.Replacement.ForElementMatchersA replacement that substitutes a member based on a row of element matchers.static classMemberSubstitution.Replacement.ForFirstBindingA replacement that only resolves the first matching replacement of a list of replacements.static classMemberSubstitution.Replacement.InvocationTypeDescribes a method invocation type.static classMemberSubstitution.Replacement.NoOpA non-operational replacement.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MemberSubstitution.Replacement.Bindingbind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, FieldDescription fieldDescription, boolean writeAccess)Binds this replacement for a field that was discovered.MemberSubstitution.Replacement.Bindingbind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, MethodDescription methodDescription, MemberSubstitution.Replacement.InvocationType invocationType)Binds this replacement for a field that was discovered.MemberSubstitution.Replacement.Bindingbind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, JavaConstant.MethodHandle methodHandle, JavaConstant.MethodType methodType, java.lang.String name, java.util.List<JavaConstant> constants)Binds this replacement for a dynamic method invocation that was discovered.
-
-
-
Method Detail
-
bind
MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypeDescription typeDescription, FieldDescription fieldDescription, boolean writeAccess)
Binds this replacement for a field that was discovered.- Parameters:
instrumentedType- The instrumented type.instrumentedMethod- The instrumented method.typeDescription- The type on which the field was read.fieldDescription- The field that was discovered.writeAccess-trueif this field was written to.- Returns:
- A binding for the discovered field access.
-
bind
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.- Parameters:
instrumentedType- The instrumented type.FieldDescriptioninstrumentedMethod- 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.
-
bind
MemberSubstitution.Replacement.Binding bind(TypeDescription instrumentedType, MethodDescription instrumentedMethod, JavaConstant.MethodHandle methodHandle, JavaConstant.MethodType methodType, java.lang.String name, java.util.List<JavaConstant> constants)
Binds this replacement for a dynamic method invocation that was discovered.- Parameters:
instrumentedType- The instrumented type.FieldDescriptioninstrumentedMethod- The instrumented method.methodHandle- The method handle of the bootstrap method.name- The name of the method that is bound.methodType- The type of the method that is bound.constants- The constant arguments to the bootstrap method.- Returns:
- A binding for the discovered method invocation.
-
-