Class InstantiateTransformer<T>
java.lang.Object
org.apache.commons.collections4.functors.InstantiateTransformer<T>
- Type Parameters:
- T- the type of the input and result to the function.
- All Implemented Interfaces:
- Function<Class<? extends T>,,- T> - Transformer<Class<? extends T>,- T> 
Transformer implementation that creates a new object instance by reflection.
 
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.
- Since:
- 3.0
- 
Constructor SummaryConstructorsConstructorDescriptionInstantiateTransformer(Class<?>[] paramTypes, Object[] args) Constructor that performs no validation.
- 
Method SummaryModifier and TypeMethodDescriptionstatic <T> Transformer<Class<? extends T>, T> Gets a typed no-arg instance.static <T> Transformer<Class<? extends T>, T> instantiateTransformer(Class<?>[] paramTypes, Object[] args) Transformer method that performs validation.Transforms the input Class object to a result by instantiation.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.collections4.Transformerapply
- 
Constructor Details- 
InstantiateTransformerConstructor that performs no validation. UseinstantiateTransformerif you want that.Note: from 4.0, the input parameters will be cloned - Parameters:
- paramTypes- the constructor parameter types
- args- the constructor arguments
 
 
- 
- 
Method Details- 
instantiateTransformerGets a typed no-arg instance.- Type Parameters:
- T- the type of the objects to be created
- Returns:
- Transformer<Class<? extends T>, T>
 
- 
instantiateTransformerpublic static <T> Transformer<Class<? extends T>,T> instantiateTransformer(Class<?>[] paramTypes, Object[] args) Transformer method that performs validation.- Type Parameters:
- T- the type of the objects to be created
- Parameters:
- paramTypes- the constructor parameter types
- args- the constructor arguments
- Returns:
- an instantiate transformer
- Throws:
- IllegalArgumentException- if paramTypes does not match args
 
- 
transform
 
-