Top Description Constructors Methods
org.codehaus.commons.compiler.samples

public Class DemoBase

extends Object
Class Inheritance
Known Direct Subclasses
org.codehaus.commons.compiler.samples.ExpressionDemo, org.codehaus.commons.compiler.samples.ScriptDemo
Imports
java.lang.reflect.InvocationTargetException, java.util.ArrayList, .List, .StringTokenizer

Common base class for the "...Demo" classes that demostrate Janino.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static Object
createObject(Class<?> type, 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.

public static String[]

Returns:

s, split at the commas
explode
(String s)

public static Class<?>

Returns:

s, converted to a Java type
stringToType
(String s)

public static Class<?>[]
stringToTypes(String s)

Converts the given comma-separated list of class names to an array of Classes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DemoBaseback to summary
protected DemoBase()

Method Detail

createObjectback to summary
public static Object createObject(Class<?> type, String value) throws NoSuchMethodException, InstantiationException, InvocationTargetException, IllegalAccessException

Creates an instance of the given type, by calling the single-string-parameter constructor, or, if the value equals "", the zero-parameter constructor.

explodeback to summary
public static String[] explode(String s)
Returns:String[]

s, split at the commas

stringToTypeback to summary
public static Class<?> stringToType(String s)
Returns:Class<?>

s, converted to a Java type

stringToTypesback to summary
public static Class<?>[] stringToTypes(String s)

Converts the given comma-separated list of class names to an array of Classes.