當前位置: 首頁>>代碼示例>>Java>>正文


Java ScriptEngine.LANGUAGE_VERSION屬性代碼示例

本文整理匯總了Java中javax.script.ScriptEngine.LANGUAGE_VERSION屬性的典型用法代碼示例。如果您正苦於以下問題:Java ScriptEngine.LANGUAGE_VERSION屬性的具體用法?Java ScriptEngine.LANGUAGE_VERSION怎麽用?Java ScriptEngine.LANGUAGE_VERSION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javax.script.ScriptEngine的用法示例。


在下文中一共展示了ScriptEngine.LANGUAGE_VERSION屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getParameter

@Override
public Object getParameter(String key) {
	switch(key) {
		case ScriptEngine.ENGINE:
			return getEngineName();
		case ScriptEngine.ENGINE_VERSION:
			return getEngineVersion();
		case ScriptEngine.LANGUAGE:
			return getLanguageName();
		case ScriptEngine.LANGUAGE_VERSION:
			return getLanguageVersion();
		case ScriptEngine.NAME:
			return getNames().get(0);
		default:
			return null;
	}
}
 
開發者ID:dmac100,項目名稱:JShellScriptEngine,代碼行數:17,代碼來源:JShellScriptEngineFactory.java

示例2: getParameter

@Override
public Object getParameter(String key) {
    switch (key) {
        case ScriptEngine.ENGINE:
            return getEngineName();
        case ScriptEngine.ENGINE_VERSION:
            return getEngineVersion();
        case ScriptEngine.LANGUAGE:
            return getLanguageName();
        case ScriptEngine.LANGUAGE_VERSION:
            return getLanguageVersion();
        case ScriptEngine.NAME:
            return getNames().get(0);
    }
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:IndentScriptEngineHack.java

示例3: getParameter

@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");
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:21,代碼來源:NashornScriptEngineFactory.java

示例4: getParameter

@Override
public Object getParameter(String key) {
    switch (key) {
    case ScriptEngine.NAME:
        return NAME;
    case ScriptEngine.ENGINE:
        return ENGINE;
    case ScriptEngine.ENGINE_VERSION:
        return ENGINE_VERSION;
    case ScriptEngine.LANGUAGE:
        return LANGUAGE;
    case ScriptEngine.LANGUAGE_VERSION:
        return LANGUAGE_VERSION;
    case "THREADING":
        // the engine implementation is not thread-safe.
        return null;
    default:
        throw new IllegalArgumentException("Invalid parameter.");
    }
}
 
開發者ID:jcapsule,項目名稱:jwebassembly,代碼行數:20,代碼來源:WasmScriptEngineFactory.java

示例5: getParameter

@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;
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:21,代碼來源:NashornScriptEngineFactory.java

示例6: getParameter

@Override
public Object getParameter(String key) {
    switch(key) {
        case ScriptEngine.ENGINE: return getEngineName();
        case ScriptEngine.ENGINE_VERSION: return getEngineVersion();
        case ScriptEngine.LANGUAGE: return getLanguageName();
        case ScriptEngine.LANGUAGE_VERSION: return getLanguageVersion();
        case ScriptEngine.NAME: return getNames().get(0);
        case "THREADING": return "STATELESS";
        default: return null;
    }
}
 
開發者ID:natanbc,項目名稱:GabrielBot,代碼行數:12,代碼來源:Factory.java


注:本文中的javax.script.ScriptEngine.LANGUAGE_VERSION屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。