Package net.bytebuddy.build
Interface Plugin
- All Superinterfaces:
AutoCloseable
,Closeable
,ElementMatcher<TypeDescription>
- All Known Subinterfaces:
Plugin.WithInitialization
,Plugin.WithPreprocessor
- All Known Implementing Classes:
AccessControllerPlugin
,CachedReturnPlugin
,DispatcherAnnotationPlugin
,HashCodeAndEqualsPlugin
,HashCodeAndEqualsPlugin.WithNonNullableFields
,Plugin.ForElementMatcher
,Plugin.NoOp
,RenamingPlugin
,RepeatedAnnotationPlugin
,ToStringPlugin
A plugin that allows for the application of Byte Buddy transformations during a build process. This plugin's transformation is applied to any type matching this plugin's type matcher. Plugin types must be public, non-abstract and must declare a public default constructor to work.
A plugin is always used within the scope of a single plugin engine application and is disposed after closing. It might be used
concurrently and must assure its own thread-safety if run outside of a Plugin.Engine
or when using a parallel
Plugin.Engine.Dispatcher
.
For discoverability, plugin class names can be stored in a file named META-INF/net.bytebuddy/build.plugins with the fully qualified class name of the plugin per line.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A plugin engine allows the application of one or more plugins on class files found at aPlugin.Engine.Source
which are then transferred and consumed by aPlugin.Engine.Target
.static interface
A factory for providing a build plugin.static class
An abstract base for aPlugin
that matches types by a givenElementMatcher
.static class
A non-operational plugin that does not instrument any type.static interface
Allows for the generation of types before a plugin is applied.static interface
A plugin that applies a preprocessor, i.e.Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Method Summary
Modifier and TypeMethodDescriptionapply
(DynamicType.Builder<?> builder, TypeDescription typeDescription, ClassFileLocator classFileLocator) Applies this plugin.Methods inherited from interface net.bytebuddy.matcher.ElementMatcher
matches
-
Method Details
-
apply
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.
-