public class InstantiateTransformer<T> extends Objectimplements Transformer <Class <? extends T> ,T>
WARNING: from v4.1 onwards this class will not be serializable anymore in order to prevent potential remote code execution exploits. Please refer to COLLECTIONS-580 for more details.
| Constructor and Description |
|---|
InstantiateTransformer(Class
Constructor that performs no validation.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Transformer |
instantiateTransformer()
Get a typed no-arg instance.
|
static <T> Transformer |
instantiateTransformer(Class
Transformer method that performs validation.
|
T |
transform(Class
Transforms the input Class object to a result by instantiation.
|
public InstantiateTransformer(Class<?>[] paramTypes, Object [] args)
instantiateTransformer if you want that.
Note: from 4.0, the input parameters will be cloned
paramTypes - the constructor parameter types
args - the constructor arguments
public static <T> Transformer<Class <? extends T> ,T> instantiateTransformer()
T - the type of the objects to be created
public static <T> Transformer<Class <? extends T> ,T> instantiateTransformer(Class <?>[] paramTypes, Object [] args)
T - the type of the objects to be created
paramTypes - the constructor parameter types
args - the constructor arguments
IllegalArgumentException - if paramTypes does not match args