当前位置: 首页>>代码示例>>Java>>正文


Java ScriptEngine.NAME属性代码示例

本文整理汇总了Java中javax.script.ScriptEngine.NAME属性的典型用法代码示例。如果您正苦于以下问题:Java ScriptEngine.NAME属性的具体用法?Java ScriptEngine.NAME怎么用?Java ScriptEngine.NAME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.script.ScriptEngine的用法示例。


在下文中一共展示了ScriptEngine.NAME属性的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.NAME属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。