Top Description Constructors Methods
net.bytebuddy.build

public Class DispatcherAnnotationPlugin

extends ForElementMatcher
implements Factory, MethodAttributeAppender
Class Inheritance
All Implemented Interfaces
net.bytebuddy.implementation.attribute.MethodAttributeAppender, net.bytebuddy.implementation.attribute.MethodAttributeAppender.Factory
Annotations
@Enhance
Imports
net.bytebuddy.asm.MemberAttributeExtension, net.bytebuddy.description.method.MethodDescription, net.bytebuddy.description.type.TypeDescription, net.bytebuddy.dynamic.ClassFileLocator, .DynamicType, net.bytebuddy.implementation.attribute.AnnotationValueFilter, .MethodAttributeAppender, net.bytebuddy.utility.dispatcher.JavaDispatcher, net.bytebuddy.jar.asm.AnnotationVisitor, .MethodVisitor, .Type

A plugin that adds a net.bytebuddy.utility.dispatcher.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.

Constructor Summary

AccessConstructor and Description
public
DispatcherAnnotationPlugin()

Creates a new dispatcher annotation plugin.

Method Summary

Modifier and TypeMethod and Description
public DynamicType.Builder<?>
apply(DynamicType.Builder<?>
The builder to use as a basis for the applied transformation.
builder
,
TypeDescription
The type being transformed.
typeDescription
,
ClassFileLocator
A class file locator that can locate other types in the scope of the project.
classFileLocator
)

Implements net.bytebuddy.build.Plugin.apply.

Applies this plugin.
public void
apply(MethodVisitor
The method visitor to which the attributes that are represented by this attribute appender are written to.
methodVisitor
,
MethodDescription
The description of the method for which the given method visitor creates an instrumentation for.
methodDescription
,
AnnotationValueFilter
The annotation value filter to apply when the annotations are written.
annotationValueFilter
)

Implements net.bytebuddy.implementation.attribute.MethodAttributeAppender.apply.

Applies this attribute appender to a given method visitor.
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public MethodAttributeAppender
make(TypeDescription
The type for which a method attribute appender is to be applied for.
typeDescription
)

Implements net.bytebuddy.implementation.attribute.MethodAttributeAppender.Factory.make.

Returns a method attribute appender that is applicable for a given type description.
Inherited from net.bytebuddy.build.Plugin.ForElementMatcher:
matches

Constructor Detail

DispatcherAnnotationPluginback to summary
public DispatcherAnnotationPlugin()

Creates a new dispatcher annotation plugin.

Method Detail

applyback to summary
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator)

Implements net.bytebuddy.build.Plugin.apply.

Doc from net.bytebuddy.build.Plugin.apply.

Applies this plugin.

Parameters
builder:DynamicType.Builder<?>

The builder to use as a basis for the applied transformation.

typeDescription:TypeDescription

The type being transformed.

classFileLocator:ClassFileLocator

A class file locator that can locate other types in the scope of the project.

Returns:DynamicType.Builder<?>

The supplied builder with additional transformations registered.

applyback to summary
public void apply(MethodVisitor methodVisitor, MethodDescription methodDescription, AnnotationValueFilter annotationValueFilter)

Implements net.bytebuddy.implementation.attribute.MethodAttributeAppender.apply.

Doc from net.bytebuddy.implementation.attribute.MethodAttributeAppender.apply.

Applies this attribute appender to a given method visitor.

Parameters
methodVisitor:MethodVisitor

The method visitor to which the attributes that are represented by this attribute appender are written to.

methodDescription:MethodDescription

The description of the method for which the given method visitor creates an instrumentation for.

annotationValueFilter:AnnotationValueFilter

The annotation value filter to apply when the annotations are written.

closeback to summary
public void close()

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

makeback to summary
public MethodAttributeAppender make(TypeDescription typeDescription)

Implements net.bytebuddy.implementation.attribute.MethodAttributeAppender.Factory.make.

Doc from net.bytebuddy.implementation.attribute.MethodAttributeAppender.Factory.make.

Returns a method attribute appender that is applicable for a given type description.

Parameters
typeDescription:TypeDescription

The type for which a method attribute appender is to be applied for.

Returns:MethodAttributeAppender

The method attribute appender which should be applied for the given type.