Class NashornScriptEngineFactory
- java.lang.Object
-
- jdk.nashorn.api.scripting.NashornScriptEngineFactory
- All Implemented Interfaces:
ScriptEngineFactory
@Deprecated(since="11", forRemoval=true) public final class NashornScriptEngineFactory extends Object implements ScriptEngineFactory
JSR-223 compliant script engine factory for Nashorn. The engine answers for:
- names
"nashorn"
,"Nashorn"
,"js"
,"JS"
,"JavaScript"
,"javascript"
,"ECMAScript"
, and"ecmascript"
; - MIME types
"application/javascript"
,"application/ecmascript"
,"text/javascript"
, and"text/ecmascript"
; - as well as for the extension
"js"
.
getScriptEngine(String[])
will have the passed arguments accessible as a global variable named "arguments"
. - Since:
- 1.8u40
Constructors
Constructor | Description |
---|---|
NashornScriptEngineFactory() | Deprecated, for removal: This API element is subject to removal in a future version. |
Methods
Modifier and Type | Method | Description |
---|---|---|
ScriptEngine | getScriptEngine(ClassLoader appLoader) | Deprecated, for removal: This API element is subject to removal in a future version. Create a new Script engine initialized with the given class loader. |
ScriptEngine | getScriptEngine(String... args) | Deprecated, for removal: This API element is subject to removal in a future version. Create a new Script engine initialized with the given arguments. |
ScriptEngine | getScriptEngine(String[] args,
ClassLoader appLoader) | Deprecated, for removal: This API element is subject to removal in a future version. Create a new Script engine initialized with the given arguments and the given class loader. |
ScriptEngine | getScriptEngine(String[] args,
ClassLoader appLoader,
ClassFilter classFilter) | Deprecated, for removal: This API element is subject to removal in a future version. Create a new Script engine initialized with the given arguments, class loader and class filter. |
ScriptEngine | getScriptEngine(ClassFilter classFilter) | Deprecated, for removal: This API element is subject to removal in a future version. Create a new Script engine initialized with the given class filter. |
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface javax.script.ScriptEngineFactory
getEngineName, getEngineVersion, getExtensions, getLanguageName, getLanguageVersion, getMethodCallSyntax, getMimeTypes, getNames, getOutputStatement, getParameter, getProgram, getScriptEngine
Constructors
NashornScriptEngineFactory
public NashornScriptEngineFactory()
Methods
getScriptEngine
public ScriptEngine getScriptEngine(ClassLoader appLoader)
Create a new Script engine initialized with the given class loader.
- Parameters:
-
appLoader
- class loader to be used as script "app" class loader. - Returns:
- newly created script engine.
- Throws:
-
SecurityException
- if the security manager'scheckPermission
deniesRuntimePermission("nashorn.setConfig")
getScriptEngine
public ScriptEngine getScriptEngine(ClassFilter classFilter)
Create a new Script engine initialized with the given class filter.
- Parameters:
-
classFilter
- class filter to use. - Returns:
- newly created script engine.
- Throws:
-
NullPointerException
- ifclassFilter
isnull
-
SecurityException
- if the security manager'scheckPermission
deniesRuntimePermission("nashorn.setConfig")
getScriptEngine
public ScriptEngine getScriptEngine(String... args)
Create a new Script engine initialized with the given arguments.
- Parameters:
-
args
- arguments array passed to script engine. - Returns:
- newly created script engine.
- Throws:
-
NullPointerException
- ifargs
isnull
-
SecurityException
- if the security manager'scheckPermission
deniesRuntimePermission("nashorn.setConfig")
getScriptEngine
public ScriptEngine getScriptEngine(String[] args, ClassLoader appLoader)
Create a new Script engine initialized with the given arguments and the given class loader.
- Parameters:
-
args
- arguments array passed to script engine. -
appLoader
- class loader to be used as script "app" class loader. - Returns:
- newly created script engine.
- Throws:
-
NullPointerException
- ifargs
isnull
-
SecurityException
- if the security manager'scheckPermission
deniesRuntimePermission("nashorn.setConfig")
getScriptEngine
public ScriptEngine getScriptEngine(String[] args, ClassLoader appLoader, ClassFilter classFilter)
Create a new Script engine initialized with the given arguments, class loader and class filter.
- Parameters:
-
args
- arguments array passed to script engine. -
appLoader
- class loader to be used as script "app" class loader. -
classFilter
- class filter to use. - Returns:
- newly created script engine.
- Throws:
-
NullPointerException
- ifargs
orclassFilter
isnull
-
SecurityException
- if the security manager'scheckPermission
deniesRuntimePermission("nashorn.setConfig")
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/jdk.scripting.nashorn/jdk/nashorn/api/scripting/NashornScriptEngineFactory.html