Context cx = ContextFactory.getGlobal().enterContext();
try {
// Initialize the standard objects (Object, Function, etc.)
// This must be done before scripts can be executed. Returns
// a scope object that we use in later calls.
Scriptable scope = new RhinoScriptable();
scope.getClassName();
// Collect the arguments into a single string.
String[] args = { "var s=5;", "s++;", "s+=2;", "s = \'" + scope.getClassName() + "\'" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
String s = ""; //$NON-NLS-1$
for ( int i = 0; i < args.length; i++ ) {
s += args[i];
}
// Now evaluate the string we've colected.