Package net.bytebuddy.asm
Class MemberSubstitution.Replacement.ForDynamicInvocation.Factory
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Replacement.ForDynamicInvocation.Factory
- All Implemented Interfaces:
MemberSubstitution.Replacement.Factory
- Enclosing class:
MemberSubstitution.Replacement.ForDynamicInvocation
@Enhance
protected static class MemberSubstitution.Replacement.ForDynamicInvocation.Factory
extends Object
implements MemberSubstitution.Replacement.Factory
A factory for a replacement for an invokedynamic instruction.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Replacement.Factory
MemberSubstitution.Replacement.Factory.Compound
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ElementMatcher.Junction
<? super List<JavaConstant>> A matcher for an invokedynamic instruction's constant arguments.private final ElementMatcher
<? super JavaConstant.MethodHandle> A matcher for an invokedynamic bootstrap method.private final ElementMatcher.Junction
<? super String> A matcher for an invokedynamic instruction's name.private final MemberSubstitution.Substitution.Factory
A factory for creating a substitution.private final ElementMatcher.Junction
<? super JavaConstant.MethodType> A matcher for an invokedynamic instruction's result type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Factory
(ElementMatcher<? super JavaConstant.MethodHandle> handleMatcher, ElementMatcher.Junction<? super String> nameMatcher, ElementMatcher.Junction<? super JavaConstant.MethodType> typeMatcher, ElementMatcher.Junction<? super List<JavaConstant>> argumentsMatcher, MemberSubstitution.Substitution.Factory substitutionFactory) Creates a factory for a replacement for a replacement for an invokedynamic instruction. -
Method Summary
Modifier and TypeMethodDescriptionmake
(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a replacement for an instrumented method.
-
Field Details
-
handleMatcher
A matcher for an invokedynamic bootstrap method. -
nameMatcher
A matcher for an invokedynamic instruction's name. -
typeMatcher
A matcher for an invokedynamic instruction's result type. -
argumentsMatcher
A matcher for an invokedynamic instruction's constant arguments. -
substitutionFactory
A factory for creating a substitution.
-
-
Constructor Details
-
Factory
protected Factory(ElementMatcher<? super JavaConstant.MethodHandle> handleMatcher, ElementMatcher.Junction<? super String> nameMatcher, ElementMatcher.Junction<? super JavaConstant.MethodType> typeMatcher, ElementMatcher.Junction<? super List<JavaConstant>> argumentsMatcher, MemberSubstitution.Substitution.Factory substitutionFactory) Creates a factory for a replacement for a replacement for an invokedynamic instruction.- Parameters:
handleMatcher
- A matcher for an invokedynamic bootstrap method.nameMatcher
- A matcher for an invokedynamic instruction's name.typeMatcher
- A matcher for an invokedynamic instruction's result type.argumentsMatcher
- A matcher for an invokedynamic instruction's constant arguments.substitutionFactory
- A factory for creating a substitution.
-
-
Method Details
-
make
public MemberSubstitution.Replacement make(TypeDescription instrumentedType, MethodDescription instrumentedMethod, TypePool typePool) Creates a replacement for an instrumented method.- Specified by:
make
in interfaceMemberSubstitution.Replacement.Factory
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.typePool
- The type pool being used within the member substitution being applied.- Returns:
- A replacement to use within the supplied instrumented method.
-