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 java.lang.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
Fields Modifier and Type Field Description private ElementMatcher<? super MethodDescription>
matcher
The matcher to identify methods to be wrapped.private java.util.List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper>
methodVisitorWrappers
The method visitor wrapper to be applied if the given matcher is matched.
-
Constructor Summary
Constructors Modifier Constructor Description protected
Entry(ElementMatcher<? super MethodDescription> matcher, java.util.List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
Creates a new entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
matches(MethodDescription target)
Matches a target against this element matcher.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.
-
-
-
Field Detail
-
matcher
private final ElementMatcher<? super MethodDescription> matcher
The matcher to identify methods to be wrapped.
-
methodVisitorWrappers
private final java.util.List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers
The method visitor wrapper to be applied if the given matcher is matched.
-
-
Constructor Detail
-
Entry
protected Entry(ElementMatcher<? super MethodDescription> matcher, java.util.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 Detail
-
matches
public boolean matches(MethodDescription target)
Matches a target against this element matcher.- Specified by:
matches
in interfaceElementMatcher<MethodDescription>
- Parameters:
target
- The instance to be matched.- Returns:
true
if the given element is matched by this matcher orfalse
otherwise.
-
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:
wrap
in 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 ASMClassWriter
reader flags to consider.readerFlags
- The ASMClassReader
reader flags to consider.- Returns:
- The wrapped method visitor.
-
-