程序包 com.script
接口 Compilable
public interface Compilable
The optional interface implemented by ScriptEngines whose methods compile scripts
to a form that can be executed repeatedly without recompilation.
- 从以下版本开始:
- 1.6
-
方法概要
修饰符和类型方法说明Compiles the script (source read fromReader) for later execution.Compiles the script (source represented as aString) for later execution.
-
方法详细资料
-
compile
Compiles the script (source represented as aString) for later execution.- 参数:
script- The source of the script, represented as aString.- 返回:
- An instance of a subclass of
CompiledScriptto be executed later using one of theevalmethods ofCompiledScript. - 抛出:
ScriptException- if compilation fails.NullPointerException- if the argument is null.
-
compile
Compiles the script (source read fromReader) for later execution. Functionality is identical tocompile(String)other than the way in which the source is passed.- 参数:
script- The reader from which the script source is obtained.- 返回:
- An instance of a subclass of
CompiledScriptto be executed later using one of itsevalmethods ofCompiledScript. - 抛出:
ScriptException- if compilation fails.NullPointerException- if argument is null.
-