public class PlasticManager extends Object implements PlasticClassListenerHub
withClassLoader(ClassLoader) or withContextClassLoader(), then configuring
the returned options object before invoking PlasticManager.PlasticManagerBuilder.create().| Modifier and Type | Class and Description |
|---|---|
static class |
PlasticManager.PlasticManagerBuilder
A builder object for configuring the PlasticManager before instantiating it.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPlasticClassListener(PlasticClassListener listener) |
<T> ClassInstantiator<T> |
createClass(Class<T> baseClass,
PlasticClassTransformer callback)
Creates an entirely new class, extending from the provided base class.
|
<T> ClassInstantiator<T> |
createProxy(Class<T> interfaceType,
Class<? extends T> implementationType,
PlasticClassTransformer callback)
Creates an entirely new class.
|
<T> ClassInstantiator<T> |
createProxy(Class<T> interfaceType,
Class<? extends T> implementationType,
PlasticClassTransformer callback,
boolean introduceInterface)
Creates an entirely new class.
|
<T> ClassInstantiator<T> |
createProxy(Class<T> interfaceType,
PlasticClassTransformer callback)
Creates an entirely new class.
|
<T> ClassInstantiator<T> |
createProxy(Class<T> interfaceType,
PlasticClassTransformer callback,
boolean introduceInterface)
Creates an entirely new class.
|
<T> PlasticClassTransformation<T> |
createProxyTransformation(Class interfaceType,
Class implementationType)
Returns
createProxyTransformation(interfaceType, implementationType, true) |
<T> PlasticClassTransformation<T> |
createProxyTransformation(Class interfaceType,
Class implementationType,
boolean introduceInterface)
Creates the underlying
PlasticClassTransformation for an interface proxy. |
<T> ClassInstantiator<T> |
getClassInstantiator(String className)
Gets the
ClassInstantiator for the indicated class, which must be in a transformed package. |
ClassLoader |
getClassLoader()
Returns the ClassLoader that is used to instantiate transformed classes.
|
void |
removePlasticClassListener(PlasticClassListener listener) |
static PlasticManager.PlasticManagerBuilder |
withClassLoader(ClassLoader loader)
Creates a new builder using the specified class loader.
|
static PlasticManager.PlasticManagerBuilder |
withContextClassLoader()
Creates a new builder using the thread's context class loader.
|
public static PlasticManager.PlasticManagerBuilder withContextClassLoader()
public static PlasticManager.PlasticManagerBuilder withClassLoader(ClassLoader loader)
public ClassLoader getClassLoader()
withClassLoader(ClassLoader).public <T> ClassInstantiator<T> getClassInstantiator(String className)
ClassInstantiator for the indicated class, which must be in a transformed package.className - fully qualified class nameIllegalArgumentException - if the class is not a transformed classpublic <T> ClassInstantiator<T> createClass(Class<T> baseClass, PlasticClassTransformer callback)
baseClass - class to extend from, which must be a class, not an interfacecallback - used to configure the new classpublic <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, PlasticClassTransformer callback)
interfaceType - class to extend from, which must be a class, not an interfacecallback - used to configure the new classcreateProxyTransformation(Class, Class)public <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, PlasticClassTransformer callback, boolean introduceInterface)
interfaceType - class to extend from, which must be a class, not an interfacecallback - used to configure the new classcreateProxyTransformation(Class, Class)public <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback)
interfaceType - class to extend from, which must be a class, not an interfaceimplementationType - class that implements interfaceType. It can be null.callback - used to configure the new classcreateProxyTransformation(Class, Class)public <T> ClassInstantiator<T> createProxy(Class<T> interfaceType, Class<? extends T> implementationType, PlasticClassTransformer callback, boolean introduceInterface)
interfaceType - class to extend from, which must be a class, not an interfaceimplementationType - class that implements interfaceType. It can be null.callback - used to configure the new classintroduceInterface - whether to introduce the interface to the Plastic class or not.createProxyTransformation(Class, Class)public <T> PlasticClassTransformation<T> createProxyTransformation(Class interfaceType, Class implementationType)
createProxyTransformation(interfaceType, implementationType, true)public <T> PlasticClassTransformation<T> createProxyTransformation(Class interfaceType, Class implementationType, boolean introduceInterface)
PlasticClassTransformation for an interface proxy. This should only be
used in the cases where encapsulating the PlasticClass construction into a callback is not feasible (which is the case for some of the older APIs inside Tapestry IoC).interfaceType - class proxy will extend fromimplementationType - class that implements interfaceType. It can be null.introduceInterface - whether result.getPlasticClass().introduceInterface(interfaceType); should
be called or not.public void addPlasticClassListener(PlasticClassListener listener)
addPlasticClassListener in interface PlasticClassListenerHubpublic void removePlasticClassListener(PlasticClassListener listener)
removePlasticClassListener in interface PlasticClassListenerHub5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.