@HashCodeAndEqualsPlugin.Enhance public class DispatcherAnnotationPlugin extends Plugin.ForElementMatcher implements MethodAttributeAppender.Factory, MethodAttributeAppender
JavaDispatcher.Proxied
annotation to any method of an
enhanced type where the annotation is not set. This aids in supporting obfuscators that rename methods which
makes reflection-based lookup by the proxy interface's name impossible.MethodAttributeAppender.Factory.Compound
MethodAttributeAppender.Compound, MethodAttributeAppender.Explicit, MethodAttributeAppender.Factory, MethodAttributeAppender.ForInstrumentedMethod, MethodAttributeAppender.ForReceiverType, MethodAttributeAppender.NoOp
Plugin.Engine, Plugin.Factory, Plugin.ForElementMatcher, Plugin.NoOp, Plugin.WithInitialization, Plugin.WithPreprocessor
ElementMatcher.Junction<S>
Constructor and Description |
---|
DispatcherAnnotationPlugin()
Creates a new dispatcher annotation plugin.
|
Modifier and Type | Method and Description |
---|---|
DynamicType.Builder<?> |
apply(DynamicType.Builder<?> builder,
TypeDescription typeDescription,
ClassFileLocator classFileLocator)
Applies this plugin.
|
void |
apply(MethodVisitor methodVisitor,
MethodDescription methodDescription,
AnnotationValueFilter annotationValueFilter)
Applies this attribute appender to a given method visitor.
|
void |
close() |
MethodAttributeAppender |
make(TypeDescription typeDescription)
Returns a method attribute appender that is applicable for a given type description.
|
matches
public DispatcherAnnotationPlugin()
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator)
apply
in interface Plugin
builder
- The builder to use as a basis for the applied transformation.typeDescription
- The type being transformed.classFileLocator
- A class file locator that can locate other types in the scope of the project.public void close()
close
in interface Closeable
close
in interface AutoCloseable
public MethodAttributeAppender make(TypeDescription typeDescription)
make
in interface MethodAttributeAppender.Factory
typeDescription
- The type for which a method attribute appender is to be applied for.public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription, AnnotationValueFilter annotationValueFilter)
apply
in interface MethodAttributeAppender
methodVisitor
- The method visitor to which the attributes that are represented by this attribute
appender are written to.methodDescription
- The description of the method for which the given method visitor creates an
instrumentation for.annotationValueFilter
- The annotation value filter to apply when the annotations are written.Copyright © 2014–2024. All rights reserved.