@HashCodeAndEqualsPlugin.Enhance public static class Plugin.Engine.Default extends Plugin.Engine.AbstractBase
Modifier and Type | Class and Description |
---|---|
protected static class |
Plugin.Engine.Default.SourceEntryPrependingClassFileLocator
A class file locator that shadows a given
Plugin.Engine.Source.Element 's type with the explicit element. |
Plugin.Engine.AbstractBase, Plugin.Engine.Default, Plugin.Engine.Dispatcher, Plugin.Engine.ErrorHandler, Plugin.Engine.Listener, Plugin.Engine.PoolStrategy, Plugin.Engine.Source, Plugin.Engine.Summary, Plugin.Engine.Target, Plugin.Engine.TypeStrategy
MODULE_INFO, PACKAGE_INFO, PLUGIN_FILE
Modifier | Constructor and Description |
---|---|
|
Default()
Creates a new default plugin engine that rebases types and fails fast and on unresolved types and on live initializers.
|
|
Default(ByteBuddy byteBuddy)
Creates a new default plugin engine that rebases types and fails fast and on unresolved types and on live initializers.
|
protected |
Default(ByteBuddy byteBuddy,
Plugin.Engine.TypeStrategy typeStrategy)
Creates a new default plugin engine.
|
protected |
Default(ByteBuddy byteBuddy,
Plugin.Engine.TypeStrategy typeStrategy,
Plugin.Engine.PoolStrategy poolStrategy,
ClassFileLocator classFileLocator,
ClassFileVersion classFileVersion,
Plugin.Engine.Listener listener,
Plugin.Engine.ErrorHandler errorHandler,
Plugin.Engine.Dispatcher.Factory dispatcherFactory,
ElementMatcher.Junction<? super TypeDescription> ignoredTypeMatcher)
Creates a new default plugin engine.
|
Modifier and Type | Method and Description |
---|---|
Plugin.Engine.Summary |
apply(Plugin.Engine.Source source,
Plugin.Engine.Target target,
List<? extends Plugin.Factory> factories)
Applies this plugin engine onto a given source and target.
|
Plugin.Engine |
ignore(ElementMatcher<? super TypeDescription> matcher)
Ignores all types that are matched by this matcher or any previously registered ignore matcher.
|
static void |
main(String... argument)
Runs a plugin engine using the first and second argument as source and target file location and any additional argument as
the fully qualified name of any plugin to apply.
|
static Plugin.Engine |
of(EntryPoint entryPoint,
ClassFileVersion classFileVersion,
MethodNameTransformer methodNameTransformer)
Creates a plugin engine from an
EntryPoint . |
static Set<String> |
scan(ClassLoader classLoader)
Scans a class loader for plugins declared in a META-INF/net.bytebuddy/build.plugins file.
|
Plugin.Engine |
with(ByteBuddy byteBuddy)
Defines a new Byte Buddy instance for usage for type creation.
|
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.
|
Plugin.Engine |
with(ClassFileVersion classFileVersion)
Uses the supplied
ClassFileVersion as a base for resolving multi-release jars, or null
if multi-release jars should not be resolved but be treated as regular jar files. |
Plugin.Engine |
with(Plugin.Engine.Dispatcher.Factory dispatcherFactory)
Replaces the dispatcher factory of this plugin engine with the supplied dispatcher factory.
|
Plugin.Engine |
with(Plugin.Engine.Listener listener)
Appends the supplied listener to this engine.
|
Plugin.Engine |
with(Plugin.Engine.PoolStrategy poolStrategy)
Defines a new pool strategy that determines how types are being described.
|
Plugin.Engine |
with(Plugin.Engine.TypeStrategy typeStrategy)
Defines a new type strategy which determines the transformation mode for any instrumented type.
|
Plugin.Engine |
withErrorHandlers(List<? extends Plugin.Engine.ErrorHandler> errorHandlers)
Replaces the error handlers of this plugin engine with the supplied error handlers.
|
Plugin.Engine |
withoutErrorHandlers()
Replaces the error handlers of this plugin engine without applying any error handlers.
|
apply, apply, apply, withErrorHandlers, withParallelTransformation
public Default()
public Default(ByteBuddy byteBuddy)
byteBuddy
- The Byte Buddy instance to use.protected Default(ByteBuddy byteBuddy, Plugin.Engine.TypeStrategy typeStrategy)
byteBuddy
- The Byte Buddy instance to use.typeStrategy
- The type strategy to use.protected Default(ByteBuddy byteBuddy, Plugin.Engine.TypeStrategy typeStrategy, Plugin.Engine.PoolStrategy poolStrategy, ClassFileLocator classFileLocator, @MaybeNull ClassFileVersion classFileVersion, Plugin.Engine.Listener listener, Plugin.Engine.ErrorHandler errorHandler, Plugin.Engine.Dispatcher.Factory dispatcherFactory, ElementMatcher.Junction<? super TypeDescription> ignoredTypeMatcher)
byteBuddy
- The Byte Buddy instance to use.typeStrategy
- The type strategy to use.poolStrategy
- The pool strategy to use.classFileLocator
- The class file locator to use.classFileVersion
- The class file version to use for multi-release jars, or null
.listener
- The listener to use.errorHandler
- The error handler to use.dispatcherFactory
- The dispatcher factory to use.ignoredTypeMatcher
- A matcher for types to exclude from transformation.public static Plugin.Engine of(EntryPoint entryPoint, ClassFileVersion classFileVersion, MethodNameTransformer methodNameTransformer)
EntryPoint
.entryPoint
- The entry point to resolve into a plugin engine.classFileVersion
- The class file version to assume.methodNameTransformer
- The method name transformer to use.public static Set<String> scan(ClassLoader classLoader) throws IOException
classLoader
- The class loader to scan.IOException
- If an I/O exception occurred.public static void main(String... argument) throws ClassNotFoundException, IOException
argument
- The arguments for running the plugin engine.ClassNotFoundException
- If a plugin class cannot be found on the system class loader.IOException
- If an I/O exception occurs.public Plugin.Engine with(ByteBuddy byteBuddy)
byteBuddy
- The Byte Buddy instance to use.public Plugin.Engine with(Plugin.Engine.TypeStrategy typeStrategy)
typeStrategy
- The type stategy to use.public Plugin.Engine with(Plugin.Engine.PoolStrategy poolStrategy)
poolStrategy
- The pool strategy to use.public Plugin.Engine with(ClassFileLocator classFileLocator)
classFileLocator
- The class file locator to append.public Plugin.Engine with(@MaybeNull ClassFileVersion classFileVersion)
ClassFileVersion
as a base for resolving multi-release jars, or null
if 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.classFileVersion
- The class file version to use or null
if multi-release jars should be ignored.public Plugin.Engine with(Plugin.Engine.Listener listener)
listener
- The listener to append.public Plugin.Engine withoutErrorHandlers()
public Plugin.Engine withErrorHandlers(List<? extends Plugin.Engine.ErrorHandler> errorHandlers)
errorHandlers
- The error handlers to apply.public Plugin.Engine with(Plugin.Engine.Dispatcher.Factory dispatcherFactory)
dispatcherFactory
- The dispatcher factory to use.public Plugin.Engine ignore(ElementMatcher<? super TypeDescription> matcher)
matcher
- The ignore matcher to append.public Plugin.Engine.Summary apply(Plugin.Engine.Source source, Plugin.Engine.Target target, List<? extends Plugin.Factory> factories) throws IOException
source
- The source to use.target
- The target to use.factories
- A list of plugin factories to a apply.IOException
- If an I/O error occurs.Copyright © 2014–2025. All rights reserved.