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.NoOpNO_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 |
|---|---|
boolean |
equals(Object other) |
int |
hashCode() |
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.InDefinedShape> matcher,
AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper... methodVisitorWrapper)
Defines a new method visitor wrapper to be applied if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
method(ElementMatcher<? super MethodDescription.InDefinedShape> matcher,
List<? extends AsmVisitorWrapper.ForDeclaredMethods.MethodVisitorWrapper> methodVisitorWrappers)
Defines a new method visitor wrapper to be applied if the given method matcher is matched.
|
AsmVisitorWrapper.ForDeclaredMethods |
readerFlags(int flags)
Sets flags for the
ClassReader this wrapper is applied to. |
String |
toString() |
ClassVisitor |
wrap(TypeDescription instrumentedType,
ClassVisitor classVisitor,
Implementation.Context implementationContext,
TypePool typePool,
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.InDefinedShape> 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.InDefinedShape> 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 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)
AsmVisitorWrapperClassWriter 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 AsmVisitorWrapperflags - 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)
AsmVisitorWrapperClassReader 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 AsmVisitorWrapperflags - The currently set flags. This value should be combined (e.g. flags | foo) into the value that is returned by this wrapper.ClassReader.public ClassVisitor wrap(TypeDescription instrumentedType, ClassVisitor classVisitor, Implementation.Context implementationContext, TypePool typePool, int writerFlags, int readerFlags)
AsmVisitorWrapperClassVisitorWrapper to the creation of a DynamicType.wrap in interface AsmVisitorWrapperinstrumentedType - 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.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–2016. All rights reserved.