Class InstantiateFactory<T>
java.lang.Object
org.apache.commons.collections4.functors.InstantiateFactory<T>
- Type Parameters:
- T- the type of results supplied by this supplier.
Factory 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 SummaryConstructorsConstructorDescriptionInstantiateFactory(Class<T> classToInstantiate) Constructor that performs no validation.InstantiateFactory(Class<T> classToInstantiate, Class<?>[] paramTypes, Object[] args) Constructor that performs no validation.
- 
Method Summary
- 
Constructor Details- 
InstantiateFactoryConstructor that performs no validation. UseinstantiateFactoryif you want that.- Parameters:
- classToInstantiate- the class to instantiate
 
- 
InstantiateFactoryConstructor that performs no validation. UseinstantiateFactoryif you want that.- Parameters:
- classToInstantiate- the class to instantiate
- paramTypes- the constructor parameter types, cloned
- args- the constructor arguments, cloned
 
 
- 
- 
Method Details- 
instantiateFactorypublic static <T> Factory<T> instantiateFactory(Class<T> classToInstantiate, Class<?>[] paramTypes, Object[] args) Factory method that performs validation.- Type Parameters:
- T- the type the factory creates
- Parameters:
- classToInstantiate- the class to instantiate, not null
- paramTypes- the constructor parameter types, cloned
- args- the constructor arguments, cloned
- Returns:
- a new instantiate factory
- Throws:
- NullPointerException- if classToInstantiate is null
- IllegalArgumentException- if paramTypes does not match args
 
- 
create
 
-