ScriptLoader (abstract)
Script (abstract)
ScriptException;.Script.Element (abstract inner)
Scriptable (interface)
ScriptInfo getScriptInfo();.ScriptInfo
ScriptScriptException
One of the applications of GSI is a simple application that can run most any script (assuming its valid and can run solo (that is doesnt need an application to communicate with)) as an application:
<CODE>
package org.jos.apps;
import org.jos.gsi.*;
public class ScriptRunner {
private Script script;
public static void main(String args[]) {
ScriptRunner runner;
if(args.length < 1) {
System.out.println("You must specify a script file in the command arguments.");
System.exit(1);
}
runner = new ScriptRunner(args[0]); //or is that args[1], I can never remember
runner.start();
System.exit(0);
}
public ScriptRunner(String scriptToRun) {
try {
script = ScriptLoader.load(scriptToRun)
} catch(ScriptException e) {
System.out.println(e);
}
}
public void start() {
try {
script.execute();
} catch(ScriptException e) {
System.out.println(e);
}
}
}
This app has no idea what script or even what language its running.
--DigiGod 99.08.01