Package net.bytebuddy.build
Interface Plugin.Engine
-
- All Known Implementing Classes:
Plugin.Engine.AbstractBase,Plugin.Engine.Default
- Enclosing interface:
- Plugin
public static interface Plugin.EngineA plugin engine allows the application of one or more plugins on class files found at aPlugin.Engine.Sourcewhich are then transferred and consumed by aPlugin.Engine.Target.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPlugin.Engine.AbstractBaseAn abstract base implementation of a plugin engine.static classPlugin.Engine.DefaultA default implementation of a plugin engine.static interfacePlugin.Engine.DispatcherA dispatcher to execute a plugin engine transformation.static interfacePlugin.Engine.ErrorHandlerAn error handler that is used during a plugin engine application.static interfacePlugin.Engine.ListenerA listener that is invoked upon any event during a plugin engine application.static interfacePlugin.Engine.PoolStrategyA pool strategy determines the creation of aTypePoolfor a plugin engine application.static interfacePlugin.Engine.SourceA source for a plugin engine provides binary elements to consider for transformation.static classPlugin.Engine.SummaryA summary of the application of aPlugin.Engineto a source and target.static interfacePlugin.Engine.TargetA target for a plugin engine represents a sink container for all elements that are supplied by aPlugin.Engine.Source.static interfacePlugin.Engine.TypeStrategyA type strategy determines the transformation that is applied to a type description.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPLUGIN_FILEThe name of the file that contains declares Byte Buddy plugins for discovery.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Plugin.Engine.Summaryapply(java.io.File source, java.io.File target, java.util.List<? extends Plugin.Factory> factories)Applies this plugin engine onto a given source and target.Plugin.Engine.Summaryapply(java.io.File source, java.io.File target, Plugin.Factory... factory)Applies this plugin engine onto a given source and target.Plugin.Engine.Summaryapply(Plugin.Engine.Source source, Plugin.Engine.Target target, java.util.List<? extends Plugin.Factory> factories)Applies this plugin engine onto a given source and target.Plugin.Engine.Summaryapply(Plugin.Engine.Source source, Plugin.Engine.Target target, Plugin.Factory... factory)Applies this plugin engine onto a given source and target.Plugin.Engineignore(ElementMatcher<? super TypeDescription> matcher)Ignores all types that are matched by this matcher or any previously registered ignore matcher.Plugin.Enginewith(Plugin.Engine.Dispatcher.Factory dispatcherFactory)Replaces the dispatcher factory of this plugin engine with the supplied dispatcher factory.Plugin.Enginewith(Plugin.Engine.Listener listener)Appends the supplied listener to this engine.Plugin.Enginewith(Plugin.Engine.PoolStrategy poolStrategy)Defines a new pool strategy that determines how types are being described.Plugin.Enginewith(Plugin.Engine.TypeStrategy typeStrategy)Defines a new type strategy which determines the transformation mode for any instrumented type.Plugin.Enginewith(ByteBuddy byteBuddy)Defines a new Byte Buddy instance for usage for type creation.Plugin.Enginewith(ClassFileVersion classFileVersion)Uses the suppliedClassFileVersionas a base for resolving multi-release jars, ornullif multi-release jars should not be resolved but be treated as regular jar files.Plugin.Enginewith(ClassFileLocator classFileLocator)Appends the supplied class file locator to be queried for class files additionally to any previously registered class file locators.Plugin.EnginewithErrorHandlers(java.util.List<? extends Plugin.Engine.ErrorHandler> errorHandlers)Replaces the error handlers of this plugin engine with the supplied error handlers.Plugin.EnginewithErrorHandlers(Plugin.Engine.ErrorHandler... errorHandler)Replaces the error handlers of this plugin engine with the supplied error handlers.Plugin.EnginewithoutErrorHandlers()Replaces the error handlers of this plugin engine without applying any error handlers.Plugin.EnginewithParallelTransformation(int threads)Replaces the dispatcher factory of this plugin engine with a parallel dispatcher factory that uses the given amount of threads.
-
-
-
Field Detail
-
PLUGIN_FILE
static final java.lang.String PLUGIN_FILE
The name of the file that contains declares Byte Buddy plugins for discovery.- See Also:
- Constant Field Values
-
-
Method Detail
-
with
Plugin.Engine with(ByteBuddy byteBuddy)
Defines a new Byte Buddy instance for usage for type creation.- Parameters:
byteBuddy- The Byte Buddy instance to use.- Returns:
- A new plugin engine that is equal to this engine but uses the supplied Byte Buddy instance.
-
with
Plugin.Engine with(Plugin.Engine.TypeStrategy typeStrategy)
Defines a new type strategy which determines the transformation mode for any instrumented type.- Parameters:
typeStrategy- The type strategy to use.- Returns:
- A new plugin engine that is equal to this engine but uses the supplied type strategy.
-
with
Plugin.Engine with(Plugin.Engine.PoolStrategy poolStrategy)
Defines a new pool strategy that determines how types are being described.- Parameters:
poolStrategy- The pool strategy to use.- Returns:
- A new plugin engine that is equal to this engine but uses the supplied pool strategy.
-
with
Plugin.Engine with(ClassFileLocator classFileLocator)
Appends the supplied class file locator to be queried for class files additionally to any previously registered class file locators.- Parameters:
classFileLocator- The class file locator to append.- Returns:
- A new plugin engine that is equal to this engine but with the supplied class file locator being appended.
-
with
Plugin.Engine with(@MaybeNull ClassFileVersion classFileVersion)
Uses the suppliedClassFileVersionas a base for resolving multi-release jars, ornullif multi-release jars should not be resolved but be treated as regular jar files. This property might not be applied if the underlying location mechanism does not supply manual resource resolution. Note that classes that are of newer class file versions than the specified version are not resolved and simply copied.- Parameters:
classFileVersion- The class file version to use ornullif multi-release jars should be ignored.- Returns:
- A new plugin engine that is equal to this engine but with the supplied class file version being used.
-
with
Plugin.Engine with(Plugin.Engine.Listener listener)
Appends the supplied listener to this engine.- Parameters:
listener- The listener to append.- Returns:
- A new plugin engine that is equal to this engine but with the supplied listener being appended.
-
withoutErrorHandlers
Plugin.Engine withoutErrorHandlers()
Replaces the error handlers of this plugin engine without applying any error handlers.- Returns:
- A new plugin engine that is equal to this engine but without any error handlers being registered.
-
withErrorHandlers
Plugin.Engine withErrorHandlers(Plugin.Engine.ErrorHandler... errorHandler)
Replaces the error handlers of this plugin engine with the supplied error handlers.- Parameters:
errorHandler- The error handlers to apply.- Returns:
- A new plugin engine that is equal to this engine but with only the supplied error handlers being applied.
-
withErrorHandlers
Plugin.Engine withErrorHandlers(java.util.List<? extends Plugin.Engine.ErrorHandler> errorHandlers)
Replaces the error handlers of this plugin engine with the supplied error handlers.- Parameters:
errorHandlers- The error handlers to apply.- Returns:
- A new plugin engine that is equal to this engine but with only the supplied error handlers being applied.
-
withParallelTransformation
Plugin.Engine withParallelTransformation(int threads)
Replaces the dispatcher factory of this plugin engine with a parallel dispatcher factory that uses the given amount of threads.- Parameters:
threads- The amount of threads to use.- Returns:
- A new plugin engine that is equal to this engine but with a parallel dispatcher factory using the specified amount of threads.
-
with
Plugin.Engine with(Plugin.Engine.Dispatcher.Factory dispatcherFactory)
Replaces the dispatcher factory of this plugin engine with the supplied dispatcher factory.- Parameters:
dispatcherFactory- The dispatcher factory to use.- Returns:
- A new plugin engine that is equal to this engine but with the supplied dispatcher factory being used.
-
ignore
Plugin.Engine ignore(ElementMatcher<? super TypeDescription> matcher)
Ignores all types that are matched by this matcher or any previously registered ignore matcher.- Parameters:
matcher- The ignore matcher to append.- Returns:
- A new plugin engine that is equal to this engine but which ignores any type that is matched by the supplied matcher.
-
apply
Plugin.Engine.Summary apply(java.io.File source, java.io.File target, Plugin.Factory... factory) throws java.io.IOException
Applies this plugin engine onto a given source and target.- Parameters:
source- The source which is treated as a folder or a jar file, if a folder does not exist.target- The target which is treated as a folder or a jar file, if a folder does not exist.factory- A list of plugin factories to a apply.- Returns:
- A summary of the applied transformation.
- Throws:
java.io.IOException- If an I/O error occurs.
-
apply
Plugin.Engine.Summary apply(java.io.File source, java.io.File target, java.util.List<? extends Plugin.Factory> factories) throws java.io.IOException
Applies this plugin engine onto a given source and target.- Parameters:
source- The source which is treated as a folder or a jar file, if a folder does not exist.target- The target which is treated as a folder or a jar file, if a folder does not exist.factories- A list of plugin factories to a apply.- Returns:
- A summary of the applied transformation.
- Throws:
java.io.IOException- If an I/O error occurs.
-
apply
Plugin.Engine.Summary apply(Plugin.Engine.Source source, Plugin.Engine.Target target, Plugin.Factory... factory) throws java.io.IOException
Applies this plugin engine onto a given source and target.- Parameters:
source- The source to use.target- The target to use.factory- A list of plugin factories to a apply.- Returns:
- A summary of the applied transformation.
- Throws:
java.io.IOException- If an I/O error occurs.
-
apply
Plugin.Engine.Summary apply(Plugin.Engine.Source source, Plugin.Engine.Target target, java.util.List<? extends Plugin.Factory> factories) throws java.io.IOException
Applies this plugin engine onto a given source and target.- Parameters:
source- The source to use.target- The target to use.factories- A list of plugin factories to a apply.- Returns:
- A summary of the applied transformation.
- Throws:
java.io.IOException- If an I/O error occurs.
-
-