@HashCodeAndEqualsPlugin.Enhance public static class AsmVisitorWrapper.ForDeclaredMethods extends Object implements AsmVisitorWrapper
An ASM visitor wrapper that allows to wrap declared methods of the instrumented type with a AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper
.
Note: Inherited methods are not matched by this visitor, even if they are intercepted by a normal interception.
Modifier and Type | Class and Description |
---|---|
protected class |
AsmVisitorWrapper.ForDeclaredMethods.DispatchingVisitor
A class visitor that applies the outer ASM visitor for identifying declared methods.
|
protected static class |
AsmVisitorWrapper.ForDeclaredMethods.Entry
An entry describing a method visitor wrapper paired with a matcher for fields to be wrapped.
|
static interface |
AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper
A method visitor wrapper that allows for wrapping a
MethodVisitor defining a declared method. |
AsmVisitorWrapper.AbstractBase, AsmVisitorWrapper.Compound, AsmVisitorWrapper.ForDeclaredFields, AsmVisitorWrapper.ForDeclaredMethods, AsmVisitorWrapper.NoOp
NO_FLAGS
Modifier | Constructor and Description |
---|---|
|
ForDeclaredMethods()
Creates a new visitor wrapper for declared methods.
|
protected |
ForDeclaredMethods(List<AsmVisitorWrapper.ForDeclaredMethods.Entry> entries,
int writerFlags,
int readerFlags)
Creates a new visitor wrapper for declared methods.
|
Modifier and Type | Method and Description |
---|---|
AsmVisitorWrapper.ForDeclaredMethods |
constructor(ElementMatcher<? super MethodDescription> matcher,
AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
Defines a new method visitor wrapper to be applied on any constructor if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
constructor(ElementMatcher<? super MethodDescription> matcher,
List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
Defines a new method visitor wrapper to be applied on any constructor if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
invokable(ElementMatcher<? super MethodDescription> matcher,
AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
Defines a new method visitor wrapper to be applied on any method or constructor if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
invokable(ElementMatcher<? super MethodDescription> matcher,
List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
Defines a new method visitor wrapper to be applied on any method or constructor if the given method matcher is matched.
|
int |
mergeReader(int flags)
Defines the flags that are provided to any
ClassReader when reading a class if applicable. |
int |
mergeWriter(int flags)
Defines the flags that are provided to any
ClassWriter when writing a class. |
AsmVisitorWrapper.ForDeclaredMethods |
method(ElementMatcher<? super MethodDescription> matcher,
AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
Defines a new method visitor wrapper to be applied on any method if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
method(ElementMatcher<? super MethodDescription> matcher,
List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
Defines a new method visitor wrapper to be applied on any method if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
readerFlags(int flags)
Sets flags for the
ClassReader this wrapper is applied to. |
org.objectweb.asm.ClassVisitor |
wrap(TypeDescription instrumentedType,
org.objectweb.asm.ClassVisitor classVisitor,
Implementation.Context implementationContext,
TypePool typePool,
FieldList<FieldDescription.InDefinedShape> fields,
MethodList<?> methods,
int writerFlags,
int readerFlags)
Applies a
ClassVisitorWrapper to the creation of a DynamicType . |
AsmVisitorWrapper.ForDeclaredMethods |
writerFlags(int flags)
Sets flags for the
ClassWriter this wrapper is applied to. |
public ForDeclaredMethods()
protected ForDeclaredMethods(List<AsmVisitorWrapper.ForDeclaredMethods.Entry> entries, int writerFlags, int readerFlags)
entries
- The list of entries that describe matched methods in their application order.readerFlags
- The reader flags to set.writerFlags
- The writer flags to set.public AsmVisitorWrapper.ForDeclaredMethods method(ElementMatcher<? super MethodDescription> matcher, AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
matcher
- The matcher to identify methods to be wrapped.methodVisitorWrapper
- The method visitor wrapper to be applied if the given matcher is matched.public AsmVisitorWrapper.ForDeclaredMethods method(ElementMatcher<? super MethodDescription> matcher, List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
matcher
- The matcher to identify methods to be wrapped.methodVisitorWrappers
- The method visitor wrapper to be applied if the given matcher is matched.public AsmVisitorWrapper.ForDeclaredMethods constructor(ElementMatcher<? super MethodDescription> matcher, AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
matcher
- The matcher to identify constructors to be wrapped.methodVisitorWrapper
- The method visitor wrapper to be applied if the given matcher is matched.public AsmVisitorWrapper.ForDeclaredMethods constructor(ElementMatcher<? super MethodDescription> matcher, List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
matcher
- The matcher to identify constructors to be wrapped.methodVisitorWrappers
- The method visitor wrapper to be applied if the given matcher is matched.public AsmVisitorWrapper.ForDeclaredMethods invokable(ElementMatcher<? super MethodDescription> matcher, AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
matcher
- The matcher to identify methods or constructors to be wrapped.methodVisitorWrapper
- The method visitor wrapper to be applied if the given matcher is matched.public AsmVisitorWrapper.ForDeclaredMethods invokable(ElementMatcher<? super MethodDescription> matcher, List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
matcher
- The matcher to identify methods or constructors to be wrapped.methodVisitorWrappers
- The method visitor wrapper to be applied if the given matcher is matched.public AsmVisitorWrapper.ForDeclaredMethods writerFlags(int flags)
ClassWriter
this wrapper is applied to.flags
- The flags to set for the ClassWriter
.public AsmVisitorWrapper.ForDeclaredMethods readerFlags(int flags)
ClassReader
this wrapper is applied to.flags
- The flags to set for the ClassReader
.public int mergeWriter(int flags)
ClassWriter
when writing a class. Typically, this gives opportunity to instruct ASM
to compute stack map frames or the size of the local variables array and the operand stack. If no specific flags are required for
applying this wrapper, the given value is to be returned.mergeWriter
in interface AsmVisitorWrapper
flags
- The currently set flags. This value should be combined (e.g. flags | foo
) into the value that is returned by this wrapper.ClassWriter
.public int mergeReader(int flags)
ClassReader
when reading a class if applicable. Typically, this gives opportunity to
instruct ASM to expand or skip frames and to skip code and debug information. If no specific flags are required for applying this
wrapper, the given value is to be returned.mergeReader
in interface AsmVisitorWrapper
flags
- The currently set flags. This value should be combined (e.g. flags | foo
) into the value that is returned by this wrapper.ClassReader
.public org.objectweb.asm.ClassVisitor wrap(TypeDescription instrumentedType, org.objectweb.asm.ClassVisitor classVisitor, Implementation.Context implementationContext, TypePool typePool, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, int writerFlags, int readerFlags)
ClassVisitorWrapper
to the creation of a DynamicType
.wrap
in interface AsmVisitorWrapper
instrumentedType
- The instrumented type.classVisitor
- A ClassVisitor
to become the new primary class visitor to which the created
DynamicType
is written to.implementationContext
- The implementation context of the current instrumentation.typePool
- The type pool that was provided for the class creation.fields
- The instrumented type's fields.methods
- The instrumented type's methods non-ignored declared and virtually inherited methods.writerFlags
- The ASM ClassWriter
flags to consider.readerFlags
- The ASM ClassReader
flags to consider.ClassVisitor
that usually delegates to the ClassVisitor
delivered in the argument.Copyright © 2014–2022. All rights reserved.