Package net.bytebuddy.build
Class Plugin.Factory.UsingReflection
- java.lang.Object
-
- net.bytebuddy.build.Plugin.Factory.UsingReflection
-
- All Implemented Interfaces:
Plugin.Factory
- Enclosing interface:
- Plugin.Factory
@Enhance public static class Plugin.Factory.UsingReflection extends java.lang.Object implements Plugin.Factory
A plugin factory that uses reflection for instantiating a plugin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Plugin.Factory.UsingReflection.ArgumentResolver
Allows to resolve arguments for aPlugin
constructor.protected static interface
Plugin.Factory.UsingReflection.Instantiator
An instantiator is responsible for invoking a plugin constructor reflectively.static interface
Plugin.Factory.UsingReflection.Priority
Indicates that a constructor should be treated with a given priority if several constructors can be resolved.-
Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Factory
Plugin.Factory.Simple, Plugin.Factory.UsingReflection
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<Plugin.Factory.UsingReflection.ArgumentResolver>
argumentResolvers
A list of argument providers that can be used for instantiating the plugin.private java.lang.Class<? extends Plugin>
type
The plugin type.
-
Constructor Summary
Constructors Modifier Constructor Description UsingReflection(java.lang.Class<? extends Plugin> type)
Creates a plugin factory that uses reflection for creating a plugin.protected
UsingReflection(java.lang.Class<? extends Plugin> type, java.util.List<Plugin.Factory.UsingReflection.ArgumentResolver> argumentResolvers)
Creates a plugin factory that uses reflection for creating a plugin.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Plugin
make()
Returns a plugin that can be used for a transformation and which is subsequently closed.Plugin.Factory.UsingReflection
with(java.util.List<? extends Plugin.Factory.UsingReflection.ArgumentResolver> argumentResolvers)
Appends the supplied argument resolvers.Plugin.Factory.UsingReflection
with(Plugin.Factory.UsingReflection.ArgumentResolver... argumentResolver)
Appends the supplied argument resolvers.
-
-
-
Field Detail
-
type
private final java.lang.Class<? extends Plugin> type
The plugin type.
-
argumentResolvers
private final java.util.List<Plugin.Factory.UsingReflection.ArgumentResolver> argumentResolvers
A list of argument providers that can be used for instantiating the plugin.
-
-
Constructor Detail
-
UsingReflection
public UsingReflection(java.lang.Class<? extends Plugin> type)
Creates a plugin factory that uses reflection for creating a plugin.- Parameters:
type
- The plugin type.
-
UsingReflection
protected UsingReflection(java.lang.Class<? extends Plugin> type, java.util.List<Plugin.Factory.UsingReflection.ArgumentResolver> argumentResolvers)
Creates a plugin factory that uses reflection for creating a plugin.- Parameters:
type
- The plugin type.argumentResolvers
- A list of argument providers that can be used for instantiating the plugin.
-
-
Method Detail
-
with
public Plugin.Factory.UsingReflection with(Plugin.Factory.UsingReflection.ArgumentResolver... argumentResolver)
Appends the supplied argument resolvers.- Parameters:
argumentResolver
- A list of argument providers that can be used for instantiating the plugin.- Returns:
- A new plugin factory that uses reflection for creating a plugin that also uses the supplied argument resolvers.
-
with
public Plugin.Factory.UsingReflection with(java.util.List<? extends Plugin.Factory.UsingReflection.ArgumentResolver> argumentResolvers)
Appends the supplied argument resolvers.- Parameters:
argumentResolvers
- A list of argument providers that can be used for instantiating the plugin.- Returns:
- A new plugin factory that uses reflection for creating a plugin that also uses the supplied argument resolvers.
-
make
public Plugin make()
Returns a plugin that can be used for a transformation and which is subsequently closed.- Specified by:
make
in interfacePlugin.Factory
- Returns:
- The plugin to use for type transformations.
-
-