public class InstantiateTransformer<T> extends Object implements 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<?>[] paramTypes,
Object[] args)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
static <T> Transformer<Class<? extends T>,T> |
instantiateTransformer()
Get a typed no-arg instance.
|
static <T> Transformer<Class<? extends T>,T> |
instantiateTransformer(Class<?>[] paramTypes,
Object[] args)
Transformer method that performs validation.
|
T |
transform(Class<? extends T> input)
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 typesargs
- the constructor argumentspublic static <T> Transformer<Class<? extends T>,T> instantiateTransformer()
T
- the type of the objects to be createdpublic static <T> Transformer<Class<? extends T>,T> instantiateTransformer(Class<?>[] paramTypes, Object[] args)
T
- the type of the objects to be createdparamTypes
- the constructor parameter typesargs
- the constructor argumentsIllegalArgumentException
- if paramTypes does not match argsCopyright © 2001–2018 The Apache Software Foundation. All rights reserved.