script

Java Source Code / Java Documentation
1. JDK Core
2. JDK Modules
3. JDK Modules com.sun
4. JDK Modules com.sun.java
5. JDK Modules Platform
6. JDK Modules sun
7. Open Source Build
8. Open Source Graphic Library
9. Open Source IDE Eclipse
10. Open Source J2EE
11. Open Source JDBC Driver
12. Open Source Library
13. Open Source Library Database
14. Open Source Net
15. Open Source Script
16. Science
17. Security
18. Sevlet Container
19. SUN GlassFish
20. Swing Library
21. Web Services apache cxf 2.0.1
22. Web Services AXIS2
23. XML
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Java Source Code / Java Documentation » JDK Core » script 
OpenJDK: script
License:The GNU General Public License (GPL)
URL:https://openjdk.dev.java.net
Description:
Package NameComment
javax.script

The scripting API consists of interfaces and classes that define Java TM Scripting Engines and provides a framework for their use in Java applications. This API is intended for use by application programmers who wish to execute programs written in scripting languages in their Java applications. The scripting language programs are usually provided by the end-users of the applications.

The main areas of functionality of javax.script package include

  1. Script execution: Scripts are streams of characters used as sources for programs executed by script engines. Script execution uses {@link javax.script.ScriptEngine#eval eval} methods of {@link javax.script.ScriptEngine ScriptEngine} and methods of the {@link javax.script.Invocable Invocable} interface.

  2. Binding: This facility allows Java objects to be exposed to script programs as named variables. {@link javax.script.Bindings Bindings} and {@link javax.script.ScriptContext ScriptContext} classes are used for this purpose.

  3. Compilation: This functionality allows the intermediate code generated by the front-end of a script engine to be stored and executed repeatedly. This benefits applications that execute the same script multiple times. These applications can gain efficiency since the engines' front-ends only need to execute once per script rather than once per script execution. Note that this functionality is optional and script engines may choose not to implement it. Callers need to check for availability of the {@link javax.script.Compilable Compilable} interface using an instanceof check.

  4. Invocation: This functionality allows the reuse of intermediate code generated by a script engine's front-end. Whereas Compilation allows entire scripts represented by intermediate code to be re-executed, Invocation functionality allows individual procedures/methods in the scripts to be re-executed. As in the case with compilation, not all script engines are required to provide this facility. Caller has to check for {@link javax.script.Invocable Invocable} availability.

  5. Script engine discovery and Metadata: Applications written to the Scripting API might have specific requirements on script engines. Some may require a specific scripting language and/or version while others may require a specific implementation engine and/or version. Script engines are packaged in a specified way so that engines can be discovered at runtime and queried for attributes. The Engine discovery mechanism is based on the Service discovery mechanism described in the Jar File Specification. Script engine implementing classes are packaged in jar files that include a text resource named META-INF/services/javax.script.ScriptEngineFactory. This resource must include a line for each {@link javax.script.ScriptEngineFactory ScriptEngineFactory} that is packaged in the jar file. {@link javax.script.ScriptEngineManager ScriptEngineManager} includes {@link javax.script.ScriptEngineManager#getEngineFactories getEngineFactories} method to get all {@link javax.script.ScriptEngineFactory ScriptEngineFactory} instances discovered using this mechanism. ScriptEngineFactory has methods to query attributes about script engine.

@since 1.6
w__w__w_.___j__a_v__a_2s___.___co___m_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.