Package net.bytebuddy.asm
Class AsmVisitorWrapper.ForDeclaredMethods.Entry
java.lang.Object
net.bytebuddy.asm.AsmVisitorWrapper.ForDeclaredMethods.Entry
- All Implemented Interfaces:
AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper,ElementMatcher<MethodDescription>
- Enclosing class:
AsmVisitorWrapper.ForDeclaredMethods
@Enhance
protected static class AsmVisitorWrapper.ForDeclaredMethods.Entry
extends Object
implements ElementMatcher<MethodDescription>, AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper
An entry describing a method visitor wrapper paired with a matcher for fields to be wrapped.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ElementMatcher<? super MethodDescription> The matcher to identify methods to be wrapped.private final List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> The method visitor wrapper to be applied if the given matcher is matched. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntry(ElementMatcher<? super MethodDescription> matcher, List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers) Creates a new entry. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(MethodDescription target) Matches a target against this element matcher.org.objectweb.asm.MethodVisitorwrap(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, TypePool typePool, int writerFlags, int readerFlags) Wraps a method visitor.
-
Field Details
-
matcher
The matcher to identify methods to be wrapped. -
methodVisitorWrappers
private final List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappersThe method visitor wrapper to be applied if the given matcher is matched.
-
-
Constructor Details
-
Entry
protected Entry(ElementMatcher<? super MethodDescription> matcher, List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers) Creates a new entry.- Parameters:
matcher- The matcher to identify methods to be wrapped.methodVisitorWrappers- The method visitor wrapper to be applied if the given matcher is matched.
-
-
Method Details
-
matches
Matches a target against this element matcher.- Specified by:
matchesin interfaceElementMatcher<MethodDescription>- Parameters:
target- The instance to be matched ornull.- Returns:
trueif the given element is matched by this matcher orfalseotherwise.
-
wrap
public org.objectweb.asm.MethodVisitor wrap(TypeDescription instrumentedType, MethodDescription instrumentedMethod, org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, TypePool typePool, int writerFlags, int readerFlags) Wraps a method visitor.- Specified by:
wrapin interfaceAsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper- Parameters:
instrumentedType- The instrumented type.instrumentedMethod- The method that is currently being defined.methodVisitor- The original field visitor that defines the given method.implementationContext- The implementation context to use.typePool- The type pool to use.writerFlags- The ASMClassWriterreader flags to consider.readerFlags- The ASMClassReaderreader flags to consider.- Returns:
- The wrapped method visitor.
-