org.clapper.util.scripting.bsf
Class BSFScriptEngine

java.lang.Object
  extended by org.clapper.util.scripting.UnifiedScriptEngine
      extended by org.clapper.util.scripting.bsf.BSFScriptEngine

public class BSFScriptEngine
extends UnifiedScriptEngine

Version:
$Revision: 6435 $

Method Summary
 UnifiedCompiledScript compile(java.io.Reader scriptReader)
          Compile a script, if possible, returning an object that implements the UnifiedCompiledScript interface.
 java.lang.Object eval(java.lang.String scriptString)
          Evaluate a script or a script snippet and return the value of the evaluation.
 void exec(java.io.Reader scriptReader)
          Execute a script.
 void exec(UnifiedCompiledScript compiledScript)
          Execute a previously compiled script.
 
Methods inherited from class org.clapper.util.scripting.UnifiedScriptEngine
compile, compile, exec, exec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compile

public UnifiedCompiledScript compile(java.io.Reader scriptReader)
                              throws UnifiedScriptException
Compile a script, if possible, returning an object that implements the UnifiedCompiledScript interface. (The interface's name was deliberately chosen to avoid conflicts with the JSR 223 CompiledScript interface. If the underlying script engine does not support compilation, then this routine simply returns null (rather than throwing an exception).

Specified by:
compile in class UnifiedScriptEngine
Parameters:
scriptReader - a Reader that will produce the script
Returns:
a representation of the compiled script, or null if the underlying scripting engine does not support compilation
Throws:
UnifiedScriptException - compilation error
See Also:
UnifiedScriptEngine.compile(String), UnifiedScriptEngine.compile(File)

exec

public void exec(UnifiedCompiledScript compiledScript)
          throws UnifiedScriptException
Execute a previously compiled script.

Specified by:
exec in class UnifiedScriptEngine
Parameters:
compiledScript - the compiled script
Throws:
UnifiedScriptException - compilation error
See Also:
UnifiedScriptEngine.exec(File), UnifiedScriptEngine.exec(Reader)

exec

public void exec(java.io.Reader scriptReader)
          throws UnifiedScriptException
Execute a script.

Specified by:
exec in class UnifiedScriptEngine
Parameters:
scriptReader - a Reader that will produce the script
Throws:
UnifiedScriptException - compilation error
See Also:
UnifiedScriptEngine.exec(String), UnifiedScriptEngine.exec(File)

eval

public java.lang.Object eval(java.lang.String scriptString)
                      throws UnifiedScriptException
Evaluate a script or a script snippet and return the value of the evaluation.

Specified by:
eval in class UnifiedScriptEngine
Parameters:
scriptString - the script string
Returns:
the result of the evaluation, if anything
Throws:
UnifiedScriptException - on error


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.