|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.smartics.properties.utils.RuntimeUtils
public final class RuntimeUtils
Utilities to instantiate classes and access their runtime information.
Constructor Summary | |
---|---|
RuntimeUtils(ClassLoader classLoader) Default constructor. |
Method Summary | |
---|---|
Class<?> |
loadClass(com.thoughtworks.qdox.model.JavaClass 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. |
Object |
loadInstance(com.thoughtworks.qdox.model.JavaField 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 |
Constructor Detail |
---|
public RuntimeUtils(ClassLoader classLoader)
classLoader
- the class loader to use to instantiate the referenced class.
Method Detail |
---|
public Object loadInstance(com.thoughtworks.qdox.model.JavaField fieldDoc) throws ClassNotFoundException, NullPointerException
fieldDoc
.
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
fieldDoc
is
null
.
public Class<?> loadClass(com.thoughtworks.qdox.model.JavaClass classDoc) throws ClassNotFoundException, NullPointerException
classDoc
.
classDoc
- the class documentation to load the class.
NullPointerException
- if
classDoc
is
null
.
ClassNotFoundException
- if the class of the field or any depending classes cannot be loaded.
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 |