|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClassFactory
ClassFactory implementations are responsible for locating and instantiating classes. Specific implementations could take care of container-specific hacks, provide support for a scripting language, etc. TODO ? an spi-like layer that would allow to have multiple implementations of this and delegate to the first which "accepts" the given parameters ?
Method Summary | ||
---|---|---|
|
forName(String className)
|
|
|
newInstance(Class<T> c,
Class<?>[] argTypes,
Object... params)
Instantiates the given class with the given parameters, using a constructor that matches the given argTypes exactly. |
|
|
newInstance(Class<T> c,
Object... params)
Instantiates the given class with the given parameters. |
Method Detail |
---|
<C> Class<C> forName(String className) throws ClassNotFoundException
ClassNotFoundException
<T> T newInstance(Class<T> c, Object... params)
MgnlInstantiationException
- wrapping possible instantiation exceptions<T> T newInstance(Class<T> c, Class<?>[] argTypes, Object... params)
argTypes
exactly.
To pass "null" to a single-arg constructor, use newInstance(c, new Object[]{null}) (otherwise the *array* itself will be considered null)
MgnlInstantiationException
- wrapping possible instantiation exceptions
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |