本文整理汇总了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;
}
}
示例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;
}
示例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");
}
}
示例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.");
}
}
示例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;
}
}
示例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;
}
}