public class InstantiateFactory<T> extends java.lang.Object implements Factory<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 |
---|
InstantiateFactory(java.lang.Class<T> classToInstantiate)
Constructor that performs no validation.
|
InstantiateFactory(java.lang.Class<T> classToInstantiate,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] args)
Constructor that performs no validation.
|
Modifier and Type | Method and Description |
---|---|
T |
create()
Creates an object using the stored constructor.
|
static <T> Factory<T> |
instantiateFactory(java.lang.Class<T> classToInstantiate,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] args)
Factory method that performs validation.
|
public InstantiateFactory(java.lang.Class<T> classToInstantiate)
instantiateFactory
if you want that.classToInstantiate
- the class to instantiatepublic InstantiateFactory(java.lang.Class<T> classToInstantiate, java.lang.Class<?>[] paramTypes, java.lang.Object[] args)
instantiateFactory
if you want that.classToInstantiate
- the class to instantiateparamTypes
- the constructor parameter types, clonedargs
- the constructor arguments, clonedpublic static <T> Factory<T> instantiateFactory(java.lang.Class<T> classToInstantiate, java.lang.Class<?>[] paramTypes, java.lang.Object[] args)
T
- the type the factory createsclassToInstantiate
- the class to instantiate, not nullparamTypes
- the constructor parameter types, clonedargs
- the constructor arguments, clonedjava.lang.NullPointerException
- if classToInstantiate is nulljava.lang.IllegalArgumentException
- if paramTypes does not match argsCopyright © 2010 - 2020 Adobe. All Rights Reserved