|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.davesag.generica.util.ObjectAssistant
Useful helper methods for dynamically loading objects and properties.
| Constructor Summary | |
ObjectAssistant()
|
|
| Method Summary | |
static Object |
loadObjectByName(String name)
Uses the default ClassLoader to load the named class, catches all the individual exceptions and rethrows as a more general ClassNotFoundException. |
static Properties |
loadProperties(Class clazz,
String filename)
load the named properties file and return a populated Properties object. |
static Properties |
loadProperties(String filename)
load the named properties file and return a populated Properties object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ObjectAssistant()
| Method Detail |
public static Object loadObjectByName(String name)
throws ClassNotFoundException
name - The name of the class to load.
ClassNotFoundException - if anything went wrong.
public static Properties loadProperties(String filename)
throws IOException
filename - The name of the properties file relative to the root
of the classpath.
IOException - if the properties could not be loaded.
public static Properties loadProperties(Class clazz,
String filename)
throws IOException
clazz - any class in the current class path.filename - The name of the properties file relative to the root
of the classpath.
IOException - if the properties could not be loaded.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||