|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.maven.exceptions.runtime.RuntimeUtils
public final class RuntimeUtils
Utilities to instantiate classes and access their runtime information.
Method Summary | |
---|---|
static Class<?> |
loadClass(ClassLoader classLoader, com.sun.javadoc.ClassDoc classDoc) Loads the class referenced by the given classDoc . |
static Enum<?> |
loadEnumInstance(Class<?> clazz, String identifier) Loads the enumeration element instance with the given identifier from the given class. |
static Object |
loadInstance(ClassLoader classLoader, com.sun.javadoc.FieldDoc fieldDoc) Loads the instance referenced by the given fieldDoc . |
static Object |
loadStaticFieldInstance(Class<?> clazz, String identifier) Loads the static property instance with the given identifier from the given class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object loadInstance(ClassLoader classLoader, com.sun.javadoc.FieldDoc fieldDoc) throws ClassNotFoundException, NullPointerException
fieldDoc
.
classLoader
- the class loader to use to instantiate the referenced class.
fieldDoc
- the property of a class to be instantiated. This may be an enumeration element or a constant in a class.
fieldDoc
references an enumeration element or a constant,
null
otherwise.
ClassNotFoundException
- if the class of the field or any depending classes cannot be loaded.
NullPointerException
- if
classLoader
or
fieldDoc
is
null
.
public static Class<?> loadClass(ClassLoader classLoader, com.sun.javadoc.ClassDoc classDoc) throws ClassNotFoundException, NullPointerException
classDoc
.
classLoader
- the class loader to load the referenced class.
ClassNotFoundException
- if the class of the field or any depending classes cannot be loaded.
NullPointerException
- if
classLoader
or
classDoc
is
null
.
public static Enum<?> loadEnumInstance(Class<?> clazz, String identifier) throws NullPointerException
clazz
- the enumeration class that contains the requested enumeration element.
identifier
- the identifier of the enumeration element to return.
null
if the class is not an enumeration or the enumeration does not contain an element with a name matching the given identifier.
NullPointerException
- if
clazz
or
identifier
is
null
.
public static Object loadStaticFieldInstance(Class<?> clazz, String identifier) throws NullPointerException
clazz
- the class that contains the requested static property.
identifier
- the identifier of the static property to return.
null
if the class does not contain a static property with a name matching the given identifier.
NullPointerException
- if
clazz
or
identifier
is
null
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |