|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.functors.InstantiateFactory<T>
public class InstantiateFactory<T>
Factory implementation that creates a new object instance by reflection.
Constructor Summary | |
---|---|
InstantiateFactory(Class<T> classToInstantiate)
Constructor that performs no validation. |
|
InstantiateFactory(Class<T> classToInstantiate,
Class[] paramTypes,
Object[] args)
Constructor that performs no validation. |
Method Summary | ||
---|---|---|
T |
create()
Creates an object using the stored constructor. |
|
static
|
getInstance(Class<T> classToInstantiate,
Class[] paramTypes,
Object[] args)
Factory method that performs validation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstantiateFactory(Class<T> classToInstantiate)
getInstance
if you want that.
classToInstantiate
- the class to instantiatepublic InstantiateFactory(Class<T> classToInstantiate, Class[] paramTypes, Object[] args)
getInstance
if you want that.
classToInstantiate
- the class to instantiateparamTypes
- the constructor parameter types, not clonedargs
- the constructor arguments, not clonedMethod Detail |
---|
public static <T> Factory<T> getInstance(Class<T> classToInstantiate, Class[] paramTypes, Object[] args)
classToInstantiate
- the class to instantiate, not nullparamTypes
- the constructor parameter typesargs
- the constructor arguments
public T create()
create
in interface Factory<T>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |