/** Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.** This code is free software; you can redistribute it and/or modify it* under the terms of the GNU General Public License version 2 only, as* published by the Free Software Foundation. Oracle designates this* particular file as subject to the "Classpath" exception as provided* by Oracle in the LICENSE file that accompanied this code.** This code is distributed in the hope that it will be useful, but WITHOUT* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License* version 2 for more details (a copy is included in the LICENSE file that* accompanied this code).** You should have received a copy of the GNU General Public License version* 2 along with this work; if not, write to the Free Software Foundation,* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.** Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA* or visit www.oracle.com if you need additional information or have any* questions.*//**<p>The scripting API consists of interfaces and classes that defineJava™ Scripting Engines and providesa framework for their use in Java applications. This API is intendedfor use by application programmers who wish to execute programswritten in scripting languages in their Java applications. Thescripting language programs are usually provided by the end-users ofthe applications.</p><p>The main areas of functionality of <code>javax.script</code>package include</p><ol><li><p><b>Script execution</b>: Scriptsare streams of characters used as sources for programs executed byscript 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.</p><li><p><b>Binding</b>: This facilityallows Java objects to be exposed to script programs as namedvariables. {@link javax.script.Bindings Bindings} and{@link javax.script.ScriptContext ScriptContext}classes are used for this purpose.</p><li><p><b>Compilation</b>: Thisfunctionality allows the intermediate code generated by thefront-end of a script engine to be stored and executed repeatedly.This benefits applications that execute the same script multipletimes. These applications can gain efficiency since the engines'front-ends only need to execute once per script rather than once perscript execution. Note that this functionality is optional andscript engines may choose not to implement it. Callers need to checkfor availability of the {@link javax.script.Compilable Compilable}interface using an <I>instanceof</I> check.</p><li><p><b>Invocation</b>: Thisfunctionality allows the reuse of intermediate code generated by ascript engine's front-end. Whereas Compilation allows entire scriptsrepresented by intermediate code to be re-executed, Invocationfunctionality allows individual procedures/methods in the scripts tobe re-executed. As in the case with compilation, not all scriptengines are required to provide this facility. Caller has to checkfor {@link javax.script.Invocable Invocable} availability.</p><li><p><b>Script engine discovery</b>: Applicationswritten to the Scripting API might have specific requirements onscript engines. Some may require a specific scripting languageand/or version while others may require a specific implementationengine and/or version. Script engines are packaged in a specifiedway so that engines can be discovered at runtime and queried forattributes. The Engine discovery mechanism is based on the service-providerloading facility described in the {@link java.util.ServiceLoader} class.{@link javax.script.ScriptEngineManager ScriptEngineManager}includes{@link javax.script.ScriptEngineManager#getEngineFactories getEngineFactories} method to get all{@link javax.script.ScriptEngineFactory ScriptEngineFactory} instancesdiscovered using this mechanism. <code>ScriptEngineFactory</code> hasmethods to query attributes about script engine.</p></ol>@since 1.6*/package javax.script;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。