类 JavaScriptEngine
java.lang.Object
com.obermuhlner.scriptengine.java.JavaScriptEngine
- 所有已实现的接口:
Compilable,ScriptEngine
Script engine to compile and run a Java class on the fly.
-
字段概要
字段修饰符和类型字段说明private BindingStrategyprivate CompilationStrategyprivate ConstructorStrategyprivate ScriptContextprivate ClassLoaderprivate ExecutionStrategyFactoryprivate Isolationprivate NameStrategyprivate PackageResourceListingStrategyprivate ScriptInterceptorStrategy从接口继承的字段 javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明eval(Reader reader, ScriptContext context) eval(String script, ScriptContext context) getBindings(int scope) voidprivate StringreadScript(Reader reader) voidsetBindings(Bindings bindings, int scope) voidsetBindingStrategy(BindingStrategy bindingStrategy) voidsetCompilationOptions(List<String> compilationOptions) Sets options used in java compilationvoidsetCompilationStrategy(CompilationStrategy compilationStrategy) voidsetConstructorStrategy(ConstructorStrategy constructorStrategy) Sets the constructor strategy used to construct a Java instance of a class.voidsetContext(ScriptContext context) voidsetExecutionClassLoader(ClassLoader executionClassLoader) Sets theClassLoaderused to load and execute the class.voidsetExecutionStrategyFactory(ExecutionStrategyFactory executionStrategyFactory) Sets the factory for the execution strategy used to execute a method of a class instance.voidsetIsolation(Isolation isolation) Sets the isolation of the script.voidsetNameStrategy(NameStrategy nameStrategy) Sets the name strategy used to determine the Java class name from a script.voidsetPackageResourceListingStrategy(PackageResourceListingStrategy packageResourceListingStrategy) voidsetScriptInterceptorStrategy(ScriptInterceptorStrategy scriptInterceptorStrategy)
-
字段详细资料
-
nameStrategy
-
constructorStrategy
-
executionStrategyFactory
-
isolation
-
compilationOptions
-
packageResourceListingStrategy
-
bindingStrategy
-
compilationStrategy
-
scriptInterceptorStrategy
-
context
-
executionClassLoader
-
-
构造器详细资料
-
JavaScriptEngine
public JavaScriptEngine()
-
-
方法详细资料
-
setNameStrategy
Sets the name strategy used to determine the Java class name from a script.- 参数:
nameStrategy- theNameStrategyto use in this script engine
-
setConstructorStrategy
Sets the constructor strategy used to construct a Java instance of a class.- 参数:
constructorStrategy- theConstructorStrategyto use in this script engine
-
setPackageResourceListingStrategy
public void setPackageResourceListingStrategy(PackageResourceListingStrategy packageResourceListingStrategy) -
setBindingStrategy
-
setCompilationStrategy
-
setScriptInterceptorStrategy
-
setExecutionStrategyFactory
Sets the factory for the execution strategy used to execute a method of a class instance.- 参数:
executionStrategyFactory- theExecutionStrategyFactoryto use in this script engine
-
setExecutionClassLoader
Sets theClassLoaderused to load and execute the class.- 参数:
executionClassLoader- the executionClassLoader
-
setIsolation
Sets the isolation of the script.- 参数:
isolation- theIsolation
-
setCompilationOptions
Sets options used in java compilation- 参数:
compilationOptions- options to use in java compilation
-
getContext
- 指定者:
getContext在接口中ScriptEngine
-
setContext
- 指定者:
setContext在接口中ScriptEngine
-
createBindings
- 指定者:
createBindings在接口中ScriptEngine
-
getBindings
- 指定者:
getBindings在接口中ScriptEngine
-
setBindings
- 指定者:
setBindings在接口中ScriptEngine
-
put
- 指定者:
put在接口中ScriptEngine
-
get
- 指定者:
get在接口中ScriptEngine
-
eval
- 指定者:
eval在接口中ScriptEngine- 抛出:
ScriptException
-
eval
- 指定者:
eval在接口中ScriptEngine- 抛出:
ScriptException
-
eval
- 指定者:
eval在接口中ScriptEngine- 抛出:
ScriptException
-
eval
- 指定者:
eval在接口中ScriptEngine- 抛出:
ScriptException
-
eval
- 指定者:
eval在接口中ScriptEngine- 抛出:
ScriptException
-
eval
- 指定者:
eval在接口中ScriptEngine- 抛出:
ScriptException
-
compile
- 指定者:
compile在接口中Compilable- 抛出:
ScriptException
-
compile
- 指定者:
compile在接口中Compilable- 抛出:
ScriptException
-
getFactory
- 指定者:
getFactory在接口中ScriptEngine
-
readScript
- 抛出:
ScriptException
-