|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.collections15.functors.factory.InstantiateFactory<E>
public class InstantiateFactory<E>
Factory
implementation that creates a new object instance of a
specified class using by reflection.
Constructor Summary | |
---|---|
protected |
InstantiateFactory(java.lang.Class<? extends E> classToInstantiate,
java.lang.Class[] paramTypes,
java.lang.Object[] args)
Constructs a new Factory that creates instances of the
specified class, using the parameterless constructor of the class. |
Method Summary | ||
---|---|---|
E |
create()
Creates an object using the stored constructor, parameter types and arguments. |
|
static
|
getInstance(java.lang.Class<? extends T> classToInstantiate)
Creates a Factory that creates instances of the specified
class, using the parameterless constructor of the class. |
|
static
|
getInstance(java.lang.Class<? extends T> classToInstantiate,
java.lang.Class[] paramTypes,
java.lang.Object[] args)
Creates a Factory that creates instances of the specified
class, using the parameterless constructor of the class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected InstantiateFactory(java.lang.Class<? extends E> classToInstantiate, java.lang.Class[] paramTypes, java.lang.Object[] args)
Factory
that creates instances of the
specified class, using the parameterless constructor of the class.
classToInstantiate
- The class that the InstantiateFactory
should create instances of.paramTypes
- The types of the constructor parameters of the
class to instantiate.args
- The arguments passed to the constructor used to
instantiate the objects created by the
Factory
.
java.lang.IllegalArgumentException
- Thrown if the specified class is
null
, or deosn't have a
public constructor with the specified
parameter types.
java.lang.IllegalArgumentException
- Thrown if either the paramTypes
or args
arrays are
null
, are of unequal
length, or are otherwise invalid.Method Detail |
---|
public static <T> Factory<T> getInstance(java.lang.Class<? extends T> classToInstantiate, java.lang.Class[] paramTypes, java.lang.Object[] args)
Factory
that creates instances of the specified
class, using the parameterless constructor of the class.
classToInstantiate
- The class that the InstantiateFactory
should create instances of.paramTypes
- The types of the constructor parameters of the
class to instantiate.args
- The arguments passed to the constructor used to
instantiate the objects created by the
Factory
.
Factory
that creates instances of the specified
class, using the constructor with the specified parameter types
and values.
java.lang.IllegalArgumentException
- Thrown if the specified class is
null
, or deosn't have a
public constructor with the specified
parameter types.
java.lang.IllegalArgumentException
- Thrown if either the paramTypes
or args
arrays are
null
, are of unequal
length, or are otherwise invalid.public static <T> InstantiateFactory<T> getInstance(java.lang.Class<? extends T> classToInstantiate)
Factory
that creates instances of the specified
class, using the parameterless constructor of the class.
classToInstantiate
- The class that the InstantiateFactory
should create instances of.
Factory
that creates instances of the specified
class, using its parameterless constructor.
java.lang.IllegalArgumentException
- Thrown if the specified class is
null
, or deosn't have a
public parameterless constructor.public E create()
create
in interface Factory<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |