Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
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 (322)
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/tools/ShellFunctions.java
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.nashorn.tools;
import static jdk.nashorn.internal.lookup.Lookup.MH;
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import jdk.nashorn.internal.runtime.JSType;
import jdk.nashorn.internal.runtime.ScriptingFunctions;
import jdk.nashorn.internal.objects.Global;
/**
* Global functions supported only in shell interactive mode.
*/
public final class ShellFunctions {
/** Handle to implementation of {@link ShellFunctions#input} - Nashorn extension */
public static final MethodHandle INPUT = findOwnMH("input", Object.class, Object.class, Object.class, Object.class);
/** Handle to implementation of {@link ShellFunctions#evalinput} - Nashorn extension */
public static final MethodHandle EVALINPUT = findOwnMH("evalinput", Object.class, Object.class, Object.class, Object.class);
private ShellFunctions() {
}
/**
* Nashorn extension: global.input (shell-interactive-mode-only)
* Read one or more lines of input from the standard input till the
* given end marker is seen in standard input.
*
* @param self self reference
* @param endMarker String used as end marker for input
* @param prompt String used as input prompt
*
* @return line that was read
*
* @throws IOException if an exception occurs
*/
public static Object input(final Object self, final Object endMarker, final Object prompt) throws IOException {
final String endMarkerStr = (endMarker != UNDEFINED)? JSType.toString(endMarker) : "";
final String promptStr = (prompt != UNDEFINED)? JSType.toString(prompt) : ">> ";
final StringBuilder buf = new StringBuilder();
while (true) {
final String line = ScriptingFunctions.readLine(promptStr);
if (line == null || line.equals(endMarkerStr)) {
break;
}
buf.append(line);
buf.append('\n');
}
return buf.toString();
}
/**
* Nashorn extension: Reads zero or more lines from standard input and
* evaluates the concatenated string as code
*
* @param self self reference
* @param endMarker String used as end marker for input
* @param prompt String used as input prompt
*
* @return output from evaluating the script
*
* @throws IOException if an exception occurs
*/
public static Object evalinput(final Object self, final Object endMarker, final Object prompt) throws IOException {
return Global.eval(self, input(self, endMarker, prompt));
}
private static MethodHandle findOwnMH(final String name, final Class<?> rtype, final Class<?>... types) {
return MH.findStatic(MethodHandles.lookup(), ShellFunctions.class, name, MH.type(rtype, types));
}
}
⏎ jdk/nashorn/tools/ShellFunctions.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, ≈217🔥, 0💬
Popular Posts:
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...
Where to get the Java source code for Connector/J 8.0 Core API module? Java source code files for Co...
What JAR files are required to run dom\Counter.java provided in the Apache Xerces package? You can f...
commons-fileupload-1.3.3 -sources.jaris the source JAR file for Apache Commons FileUpload 1.3., whic...
maven-embedder-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Embedder module. Apache Maven is a s...