Package net.bytebuddy.build
Class DispatcherAnnotationPlugin
- java.lang.Object
-
- net.bytebuddy.build.Plugin.ForElementMatcher
-
- net.bytebuddy.build.DispatcherAnnotationPlugin
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Plugin,Plugin.Factory,MethodAttributeAppender,MethodAttributeAppender.Factory,ElementMatcher<TypeDescription>
@Enhance public class DispatcherAnnotationPlugin extends Plugin.ForElementMatcher implements Plugin.Factory, MethodAttributeAppender.Factory, MethodAttributeAppender
A plugin that adds aJavaDispatcher.Proxiedannotation 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.attribute.MethodAttributeAppender
MethodAttributeAppender.Compound, MethodAttributeAppender.Explicit, MethodAttributeAppender.Factory, MethodAttributeAppender.ForInstrumentedMethod, MethodAttributeAppender.ForReceiverType, MethodAttributeAppender.NoOp
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.attribute.MethodAttributeAppender.Factory
MethodAttributeAppender.Factory.Compound
-
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin
Plugin.Engine, Plugin.Factory, Plugin.ForElementMatcher, Plugin.NoOp, Plugin.WithInitialization, Plugin.WithPreprocessor
-
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Factory
Plugin.Factory.Simple, Plugin.Factory.UsingReflection
-
-
Constructor Summary
Constructors Constructor Description DispatcherAnnotationPlugin()Creates a new dispatcher annotation plugin.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DynamicType.Builder<?>apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator)Applies this plugin.voidapply(org.objectweb.asm.MethodVisitor methodVisitor, MethodDescription methodDescription, AnnotationValueFilter annotationValueFilter)Applies this attribute appender to a given method visitor.voidclose()Pluginmake()Returns a plugin that can be used for a transformation and which is subsequently closed.MethodAttributeAppendermake(TypeDescription typeDescription)Returns a method attribute appender that is applicable for a given type description.-
Methods inherited from class net.bytebuddy.build.Plugin.ForElementMatcher
matches
-
-
-
-
Method Detail
-
make
public Plugin make()
Returns a plugin that can be used for a transformation and which is subsequently closed.- Specified by:
makein interfacePlugin.Factory- Returns:
- The plugin to use for type transformations.
-
apply
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator)
Applies this plugin.- Specified by:
applyin interfacePlugin- Parameters:
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.- Returns:
- The supplied builder with additional transformations registered.
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
make
public MethodAttributeAppender make(TypeDescription typeDescription)
Returns a method attribute appender that is applicable for a given type description.- Specified by:
makein interfaceMethodAttributeAppender.Factory- Parameters:
typeDescription- The type for which a method attribute appender is to be applied for.- Returns:
- The method attribute appender which should be applied for the given type.
-
apply
public void apply(org.objectweb.asm.MethodVisitor methodVisitor, MethodDescription methodDescription, AnnotationValueFilter annotationValueFilter)Applies this attribute appender to a given method visitor.- Specified by:
applyin interfaceMethodAttributeAppender- Parameters:
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.
-
-