public class JavaScriptExecutorFast extends Object implements JavaScriptExecutor
| Constructor and Description |
|---|
JavaScriptExecutorFast(String name,
int optimizationLevel,
Class<?> clazz) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCallScript(String source) |
void |
addGlobalFunction(String name,
Object object) |
void |
addGlobalFunction(String name,
Object object,
String method) |
void |
addScriptFile(String file) |
void |
addScriptFile(URL url) |
void |
addScriptSource(String source,
String name) |
void |
dispose() |
void |
run(Reader input,
Writer output) |
public void addGlobalFunction(String name, Object object)
addGlobalFunction in interface JavaScriptExecutorname - The name to use of method to make availableobject - The object to make globally available in the environmentJavaScriptExecutor.addGlobalFunction(java.lang.String,
java.lang.Object)public void addGlobalFunction(String name, Object object, String method)
addGlobalFunction in interface JavaScriptExecutorname - The name to use of method to make availableobject - The object to make globally available in the environmentmethod - The name of the method to publishJavaScriptExecutor.addGlobalFunction(java.lang.String,
java.lang.Object, java.lang.String)public void addScriptSource(String source, String name)
addScriptSource in interface JavaScriptExecutorsource - The source code of a script to addname - The name of the source for debugging/error reportingJavaScriptExecutor.addScriptSource(java.lang.String,
java.lang.String)public void addScriptFile(String file)
addScriptFile in interface JavaScriptExecutorfile - The path of the file to addJavaScriptExecutor.addScriptFile(java.lang.String)public void addScriptFile(URL url)
addScriptFile in interface JavaScriptExecutorurl - The URL to load the script fromJavaScriptExecutor.addScriptFile(java.net.URL)public void addCallScript(String source)
addCallScript in interface JavaScriptExecutorsource - The source script to evaluate. This should contain %s
where the reader input should be placed.JavaScriptExecutor.addCallScript(java.lang.String)public void run(Reader input, Writer output) throws IOException
run in interface JavaScriptExecutorinput - The execution input parametersoutput - The execution resultIOExceptionJavaScriptExecutor.run(java.io.Reader,
java.io.Writer)public void dispose()
dispose in interface JavaScriptExecutorJavaScriptExecutor.dispose()Copyright © 2013. All Rights Reserved.