Overview
Profile: desktop
Inherited Variables
Constructor Summary
Method Summary
- public static java.lang.Object eval(java.lang.String script)
-
Evaluates a JavaFX Script source string and returns its result, if any.
Evaluates a JavaFX Script source string and returns its result, if any. This method depends upon the JavaFX Script compiler API being accessible by the application, such as including the
javafxc.jar
file in the application's classpath.This method also depends upon the JSR-223 API classes being accessible by the application, such as including the
script-api.jar
file in the application's classpath or the application must be run on JDK 6+ where JSR-223 API classes are part of the platform API. For JDK 5, script-api.jar has to be in application's classpath.Note: This method provides only the simplest scripting functionality; the script is evaluated without any specified context state, nor can any state it creates during evaluation be reused by other scripts. For sophisticated scripting applications, use the Java Scripting API (
javax.script
).-
Parameters
- script
- the JavaFX Script source to evaluate
-
Returns
- Object
- the results from evaluating the script, or null if no results are returned by the script.
-
Throws
- javax.script.ScriptException