public class DemoBase
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
DemoBase() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object |
createObject(java.lang.Class type,
java.lang.String value)
Creates an instance of the given
type, by calling the single-string-parameter constructor, or, if
the value equals "", the zero-parameter constructor. |
static java.lang.String[] |
explode(java.lang.String s) |
static java.lang.Class |
stringToType(java.lang.String s) |
static java.lang.Class[] |
stringToTypes(java.lang.String s)
Converts the given comma-separated list of class names to an array of
Classes. |
static java.lang.String |
toString(java.lang.Object o)
A version of
Object.toString() that pretty-prints arrays. |
public static java.lang.Object createObject(java.lang.Class type,
java.lang.String value)
throws java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
type, by calling the single-string-parameter constructor, or, if
the value equals "", the zero-parameter constructor.java.lang.NoSuchMethodExceptionjava.lang.InstantiationExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionpublic static java.lang.String[] explode(java.lang.String s)
s, split at the commaspublic static java.lang.Class stringToType(java.lang.String s)
s, converted to a Java typepublic static java.lang.Class[] stringToTypes(java.lang.String s)
Classes.public static java.lang.String toString(java.lang.Object o)
Object.toString() that pretty-prints arrays.