Class DemoBase
- java.lang.Object
-
- org.codehaus.commons.compiler.samples.DemoBase
-
- Direct Known Subclasses:
ExpressionDemo,ScriptDemo
public class DemoBase extends Object
Common base class for the "...Demo" classes that demostrate Janino.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDemoBase()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectcreateObject(Class type, String value)Creates an instance of the giventype, by calling the single-string-parameter constructor, or, if thevalueequals "", the zero-parameter constructor.static String[]explode(String s)static ClassstringToType(String s)static Class[]stringToTypes(String s)Converts the given comma-separated list of class names to an array ofClasses.static StringtoString(Object o)A version ofObject.toString()that pretty-prints arrays.
-
-
-
Method Detail
-
createObject
public static Object createObject(Class type, String value) throws NoSuchMethodException, InstantiationException, InvocationTargetException, IllegalAccessException
Creates an instance of the giventype, by calling the single-string-parameter constructor, or, if thevalueequals "", the zero-parameter constructor.
-
stringToTypes
public static Class[] stringToTypes(String s)
Converts the given comma-separated list of class names to an array ofClasses.
-
toString
public static String toString(Object o)
A version ofObject.toString()that pretty-prints arrays.
-
-