Methods Summary |
---|
public static java.lang.Object | newInstance(java.lang.String className)Create an instance of the class with the specified name by calling the
no-argument constructor.
Utils utils = new Utils();
return utils.createObject(className);
|
public static java.lang.Object | newInstance(java.lang.String className, java.lang.String argument)Create an instance of the class with the specified name by calling the
a constructor that takes an String.
Class classObject = null;
Utils utils = new Utils();
Class[] argumentTypes = new Class[] {String.class};
Constructor constructor =
utils.getConstructor(className, argumentTypes);
Object[] argumentValues = new Object[] {argument};
return utils.createObject(constructor, argumentValues);
|
public static java.lang.Object | newInstance(java.lang.String className, java.lang.Object argument)Create an instance of the class with the specified name by calling the
a constructor that takes an String.
Class classObject = null;
Utils utils = new Utils();
Class[] argumentTypes = new Class[] {Object.class};
Constructor constructor =
utils.getConstructor(className, argumentTypes);
Object[] argumentValues = new Object[] {argument};
return utils.createObject(constructor, argumentValues);
|