|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ojb.broker.util.ConstructorHelper
public class ConstructorHelper
This class helps us to construct new instances. We don't want to rely on public default constructors and have to try hard to also use private or protected constructors.
Field Summary | |
---|---|
private static Object[] |
NO_ARGS
represents a zero sized parameter array |
Constructor Summary | |
---|---|
private |
ConstructorHelper()
no public constructor, please use the static method only. |
Method Summary | |
---|---|
static Object |
instantiate(Class clazz)
create a new instance of class clazz. |
static Object |
instantiate(Constructor constructor)
create a new instance of the class represented by the no-argument constructor provided |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Object[] NO_ARGS
Constructor Detail |
---|
private ConstructorHelper()
Method Detail |
---|
public static Object instantiate(Class clazz) throws InstantiationException
clazz
- the class to instantiate
InstantiationException
public static Object instantiate(Constructor constructor) throws InstantiationException
constructor
- the zero argument constructor for the class
InstantiationException
ClassNotPersistenceCapableException
- if the constructor is null or there is an
exception while trying to create a new instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |