public class DefaultClassFactory extends Object implements ClassFactory
Constructor and Description |
---|
DefaultClassFactory() |
Modifier and Type | Method and Description |
---|---|
<C> Class<C> |
forName(String className) |
<T> T |
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. |
<T> T |
newInstance(Class<T> c,
Object... params)
Instantiates the given class with the given parameters.
|
public <C> Class<C> forName(String className) throws ClassNotFoundException
forName
in interface ClassFactory
ClassNotFoundException
public <T> T newInstance(Class<T> c, Class<?>[] argTypes, Object... params)
ClassFactory
argTypes
exactly.
To pass "null" to a single-arg constructor, use newInstance(c, new Object[]{null}) (otherwise the *array* itself will be considered null)newInstance
in interface ClassFactory
public <T> T newInstance(Class<T> c, Object... params)
ClassFactory
newInstance
in interface ClassFactory
Copyright © 2003–2020 Magnolia International Ltd.. All rights reserved.