javax.script
Interface Compilable


public interface Compilable

Optional interface implemented by script engines which can compile scripts to a form that can be executed repeatedly.

See Javadoc of Java Scripting API


Method Summary
 CompiledScript compile(Reader reader)
          Compiles the script (source is read from the Reader) for later execution.
 CompiledScript compile(String script)
          Compiles the script (sourced from the String) for later execution.
 

Method Detail

compile

CompiledScript compile(String script)
                       throws ScriptException
Compiles the script (sourced from the String) for later execution.

Parameters:
script - the source of the script represented as String
Returns:
an implementation of CompiledScript to be executed later using one of its eval() methods.
Throws:
ScriptException - if the compilation fails for any reason
NullPointerException - if script is null

compile

CompiledScript compile(Reader reader)
                       throws ScriptException
Compiles the script (source is read from the Reader) for later execution.

Parameters:
reader - the reader from which the script source is obtained
Returns:
an implementation of CompiledScript to be executed later using one of its eval() methods.
Throws:
ScriptException - if the compilation fails for any reason
NullPointerException - if reader is null


Copyright © 1999-2012 The Apache Software Foundation. All Rights Reserved.