本文整理匯總了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;
}
}
示例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;
}
}