Java Code Examples for jdk.nashorn.internal.runtime.Version#version()

The following examples show how to use jdk.nashorn.internal.runtime.Version#version() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NashornScriptEngineFactory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 2
Source File: NashornScriptEngineFactory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 3
Source File: NashornScriptEngineFactory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 4
Source File: NashornScriptEngineFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 5
Source File: NashornScriptEngineFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 6
Source File: NashornScriptEngineFactory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 7
Source File: NashornScriptEngineFactory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@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:
        throw new IllegalArgumentException("Invalid key");
    }
}
 
Example 8
Source File: NashornScriptEngineFactory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@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:
        throw new IllegalArgumentException("Invalid key");
    }
}
 
Example 9
Source File: NashornScriptEngineFactory.java    From jdk8u_nashorn with GNU General Public License v2.0 6 votes vote down vote up
@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;
    }
}
 
Example 10
Source File: NashornScriptEngineFactory.java    From nashorn with GNU General Public License v2.0 6 votes vote down vote up
@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:
        throw new IllegalArgumentException("Invalid key");
    }
}