Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 jdk.scripting.nashorn.jmod - Scripting Nashorn Module
JDK 11 jdk.scripting.nashorn.jmod is the JMOD file for JDK 11 Scripting Nashorn module.
JDK 11 Scripting Nashorn module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.scripting.nashorn.jmod.
JDK 11 Scripting Nashorn module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Scripting Nashorn module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.scripting.nashorn.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/nashorn/api/scripting/NashornScriptEngineFactory.java
/* * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.nashorn.api.scripting; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; import javax.script.ScriptEngine; import javax.script.ScriptEngineFactory; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.Version; /** * JSR-223 compliant script engine factory for Nashorn. The engine answers for: * <ul> * <li>names {@code "nashorn"}, {@code "Nashorn"}, {@code "js"}, {@code "JS"}, {@code "JavaScript"}, * {@code "javascript"}, {@code "ECMAScript"}, and {@code "ecmascript"};</li> * <li>MIME types {@code "application/javascript"}, {@code "application/ecmascript"}, {@code "text/javascript"}, and * {@code "text/ecmascript"};</li> * <li>as well as for the extension {@code "js"}.</li> * </ul> * Programs executing in engines created using {@link #getScriptEngine(String[])} will have the passed arguments * accessible as a global variable named {@code "arguments"}. * * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool * are deprecated with the intent to remove them in a future release. * * @since 1.8u40 */ @Deprecated(since="11", forRemoval=true) public final class NashornScriptEngineFactory implements ScriptEngineFactory { @Override public String getEngineName() { return (String) getParameter(ScriptEngine.ENGINE); } @Override public String getEngineVersion() { return (String) getParameter(ScriptEngine.ENGINE_VERSION); } @Override public List<String> getExtensions() { return Collections.unmodifiableList(extensions); } @Override public String getLanguageName() { return (String) getParameter(ScriptEngine.LANGUAGE); } @Override public String getLanguageVersion() { return (String) getParameter(ScriptEngine.LANGUAGE_VERSION); } @Override public String getMethodCallSyntax(final String obj, final String method, final String... args) { final StringBuilder sb = new StringBuilder(). append(Objects.requireNonNull(obj)).append('.'). append(Objects.requireNonNull(method)).append('('); final int len = args.length; if (len > 0) { sb.append(Objects.requireNonNull(args[0])); } for (int i = 1; i < len; i++) { sb.append(',').append(Objects.requireNonNull(args[i])); } sb.append(')'); return sb.toString(); } @Override public List<String> getMimeTypes() { return Collections.unmodifiableList(mimeTypes); } @Override public List<String> getNames() { return Collections.unmodifiableList(names); } @Override public String getOutputStatement(final String toDisplay) { return "print(" + toDisplay + ")"; } @Override public Object getParameter(final String key) { switch (key) { case ScriptEngine.NAME: return "javascript"; case ScriptEngine.ENGINE: return "Oracle Nashorn"; case ScriptEngine.ENGINE_VERSION: return Version.version(); case ScriptEngine.LANGUAGE: return "ECMAScript"; case ScriptEngine.LANGUAGE_VERSION: return "ECMA - 262 Edition 5.1"; case "THREADING": // The engine implementation is not thread-safe. Can't be // used to execute scripts concurrently on multiple threads. return null; default: return null; } } @Override public String getProgram(final String... statements) { Objects.requireNonNull(statements); final StringBuilder sb = new StringBuilder(); for (final String statement : statements) { sb.append(Objects.requireNonNull(statement)).append(';'); } return sb.toString(); } // default options passed to Nashorn script engine private static final String[] DEFAULT_OPTIONS = new String[] { "-doe" }; @Override public ScriptEngine getScriptEngine() { try { return new NashornScriptEngine(this, DEFAULT_OPTIONS, getAppClassLoader(), null); } catch (final RuntimeException e) { if (Context.DEBUG) { e.printStackTrace(); } throw e; } } /** * Create a new Script engine initialized with the given class loader. * * @param appLoader class loader to be used as script "app" class loader. * @return newly created script engine. * @throws SecurityException * if the security manager's {@code checkPermission} * denies {@code RuntimePermission("nashorn.setConfig")} */ public ScriptEngine getScriptEngine(final ClassLoader appLoader) { return newEngine(DEFAULT_OPTIONS, appLoader, null); } /** * Create a new Script engine initialized with the given class filter. * * @param classFilter class filter to use. * @return newly created script engine. * @throws NullPointerException if {@code classFilter} is {@code null} * @throws SecurityException * if the security manager's {@code checkPermission} * denies {@code RuntimePermission("nashorn.setConfig")} */ public ScriptEngine getScriptEngine(final ClassFilter classFilter) { return newEngine(DEFAULT_OPTIONS, getAppClassLoader(), Objects.requireNonNull(classFilter)); } /** * Create a new Script engine initialized with the given arguments. * * @param args arguments array passed to script engine. * @return newly created script engine. * @throws NullPointerException if {@code args} is {@code null} * @throws SecurityException * if the security manager's {@code checkPermission} * denies {@code RuntimePermission("nashorn.setConfig")} */ public ScriptEngine getScriptEngine(final String... args) { return newEngine(Objects.requireNonNull(args), getAppClassLoader(), null); } /** * Create a new Script engine initialized with the given arguments and the given class loader. * * @param args arguments array passed to script engine. * @param appLoader class loader to be used as script "app" class loader. * @return newly created script engine. * @throws NullPointerException if {@code args} is {@code null} * @throws SecurityException * if the security manager's {@code checkPermission} * denies {@code RuntimePermission("nashorn.setConfig")} */ public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader) { return newEngine(Objects.requireNonNull(args), appLoader, null); } /** * Create a new Script engine initialized with the given arguments, class loader and class filter. * * @param args arguments array passed to script engine. * @param appLoader class loader to be used as script "app" class loader. * @param classFilter class filter to use. * @return newly created script engine. * @throws NullPointerException if {@code args} or {@code classFilter} is {@code null} * @throws SecurityException * if the security manager's {@code checkPermission} * denies {@code RuntimePermission("nashorn.setConfig")} */ public ScriptEngine getScriptEngine(final String[] args, final ClassLoader appLoader, final ClassFilter classFilter) { return newEngine(Objects.requireNonNull(args), appLoader, Objects.requireNonNull(classFilter)); } private ScriptEngine newEngine(final String[] args, final ClassLoader appLoader, final ClassFilter classFilter) { checkConfigPermission(); try { return new NashornScriptEngine(this, args, appLoader, classFilter); } catch (final RuntimeException e) { if (Context.DEBUG) { e.printStackTrace(); } throw e; } } // -- Internals only below this point private static void checkConfigPermission() { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(new RuntimePermission(Context.NASHORN_SET_CONFIG)); } } private static final List<String> names; private static final List<String> mimeTypes; private static final List<String> extensions; static { names = immutableList( "nashorn", "Nashorn", "js", "JS", "JavaScript", "javascript", "ECMAScript", "ecmascript" ); mimeTypes = immutableList( "application/javascript", "application/ecmascript", "text/javascript", "text/ecmascript" ); extensions = immutableList("js"); } private static List<String> immutableList(final String... elements) { return Collections.unmodifiableList(Arrays.asList(elements)); } private static ClassLoader getAppClassLoader() { // Revisit: script engine implementation needs the capability to // find the class loader of the context in which the script engine // is running so that classes will be found and loaded properly final ClassLoader ccl = Thread.currentThread().getContextClassLoader(); return (ccl == null)? NashornScriptEngineFactory.class.getClassLoader() : ccl; } }
⏎ jdk/nashorn/api/scripting/NashornScriptEngineFactory.java
Or download all of them as a single archive file:
File name: jdk.scripting.nashorn-11.0.1-src.zip File size: 1390965 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.scripting.nashorn.shell.jmod - Scripting Nashorn Shell Module
2020-04-25, 107270👍, 0💬
Popular Posts:
What Is commons-codec-1.4.jar? commons-codec-1.4.jar is the JAR file for Apache Commons Codec 1.4, w...
HttpComponents Core Source Code Files are provided in the source package file, httpcomponents-core-5...
JDK 11 jdk.jdi.jmod is the JMOD file for JDK 11 JDI (Java Debug Interface) tool. JDK 11 JDI tool com...
JDK 11 java.sql.jmod is the JMOD file for JDK 11 SQL (Structured Query Language) module. JDK 11 SQL ...
How to download and install JDK (Java Development Kit) 5? If you want to write Java applications, yo...