|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.util.ClassUtils
public class ClassUtils
Title: ClassUtils
Description: Utility class comprised of static methods for creating classes dynamically at runtime. This means, given the full package class name as a String, this utility class can create an object instance. This allows for adding new classes at runtime and they can be instantiated without recompiling the code. This is real useful for the IMR Tester Applet. A picklist of IMRs are presented in the GUI. Once a user makes a selection, the IMR class name is obtained and the class created at runtime via this utility package.
| Constructor Summary | |
|---|---|
ClassUtils()
|
|
| Method Summary | |
|---|---|
static Object |
createNoArgConstructorClassInstance(ArrayList params,
ArrayList paramTypes,
String className)
Dynamically creates the class instance using the constructor with arguments. |
static Object |
createNoArgConstructorClassInstance(String className)
Dynamically creates the class instance with no argument constructor. |
static String |
getClassNameWithoutPackage(Class<?> theClass)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassUtils()
| Method Detail |
|---|
public static Object createNoArgConstructorClassInstance(String className)
BJF_1997_AttenRel imr = new BJF_1997_AttenRel()
If your not sure the user wants this one or AS_1997_AttenRel you can use this function instead to create the same class by:
BJF_1997_AttenRel imr =
(BJF_1997_AttenRel)ClassUtils.createNoArgConstructorClassInstance("org.opensha.sha.imt.attenRelImpl.BJF_1997_AttenRel");
public static Object createNoArgConstructorClassInstance(ArrayList params,
ArrayList paramTypes,
String className)
public static String getClassNameWithoutPackage(Class<?> theClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||