public abstract class MyClass
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
instantiate(java.lang.Class<?> clazz)
Utility method to instantiate a class.
|
static java.lang.Object |
instantiate(java.lang.String fullClassName)
Utility method to instantiate a class.
|
static java.lang.Object |
instantiate(java.lang.String packageName,
java.lang.String className)
Utility method to instantiate a class.
|
public static java.lang.Object instantiate(java.lang.String packageName, java.lang.String className) throws NotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
packageName
- The (fully qualified) name of the package of the class to instantiate. The zero-length string if the class is not part of a package.className
- The (simple, i.e. non-qualified) name of the class to instantiateNotFoundException
- If the class does not existjava.lang.InstantiationException
- If a new instance cannot be created because the class is abstract, is an interface, ...java.lang.IllegalAccessException
- If the invocation of the getInstance() method failedpublic static java.lang.Object instantiate(java.lang.String fullClassName) throws NotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
fullClassName
- The fully qualified classnameNotFoundException
- If the class does not existjava.lang.InstantiationException
- If a new instance cannot be created because the class is abstract, is an interface, ...java.lang.IllegalAccessException
- If the invocation of the getInstance() method failedpublic static java.lang.Object instantiate(java.lang.Class<?> clazz) throws java.lang.InstantiationException, java.lang.IllegalAccessException
clazz
- the Class object to instantiatejava.lang.InstantiationException
- If a new instance cannot be created because the class is abstract, is an interface, ...java.lang.IllegalAccessException
- If the invocation of the getInstance() method failed