Package net.bytebuddy.build
Class RepeatedAnnotationPlugin
- java.lang.Object
-
- net.bytebuddy.build.Plugin.ForElementMatcher
-
- net.bytebuddy.build.RepeatedAnnotationPlugin
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Plugin
,ElementMatcher<TypeDescription>
@Enhance public class RepeatedAnnotationPlugin extends Plugin.ForElementMatcher
A plugin that allows for adding ajava.lang.annotation.Repeatable
annotation even if compiled prior to Java 8 which introduces this annotation. As the annotation is not present on previous JVM versions, it is ignored at runtime for older JVM versions what makes this approach feasible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RepeatedAnnotationPlugin.Enhance
Indicates that the annotated annotation should be repeatable by the supplied annotation.protected static class
RepeatedAnnotationPlugin.RepeatedAnnotationAppender
A type attribute appender that adds a repeated annotation for a target type.-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin
Plugin.Engine, Plugin.Factory, Plugin.ForElementMatcher, Plugin.NoOp, Plugin.WithPreprocessor
-
-
Field Summary
Fields Modifier and Type Field Description private static MethodDescription.InDefinedShape
VALUE
A description of theRepeatedAnnotationPlugin.Enhance.value()
method.
-
Constructor Summary
Constructors Constructor Description RepeatedAnnotationPlugin()
Creates a new plugin for creating repeated annotations.
-
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.void
close()
-
Methods inherited from class net.bytebuddy.build.Plugin.ForElementMatcher
matches
-
-
-
-
Field Detail
-
VALUE
private static final MethodDescription.InDefinedShape VALUE
A description of theRepeatedAnnotationPlugin.Enhance.value()
method.
-
-
Method Detail
-
apply
public DynamicType.Builder<?> apply(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator)
Applies this plugin.- 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()
-
-