本文整理汇总了Java中javax.script.ScriptEngineFactory.getEngineVersion方法的典型用法代码示例。如果您正苦于以下问题:Java ScriptEngineFactory.getEngineVersion方法的具体用法?Java ScriptEngineFactory.getEngineVersion怎么用?Java ScriptEngineFactory.getEngineVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.script.ScriptEngineFactory
的用法示例。
在下文中一共展示了ScriptEngineFactory.getEngineVersion方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listEngines
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
/**
* Display all script engines.
*/
public static void listEngines() {
final ScriptEngineManager mgr = new ScriptEngineManager();
final List<ScriptEngineFactory> factories =
mgr.getEngineFactories();
for (final ScriptEngineFactory factory: factories) {
System.out.println("ScriptEngineFactory Info");
final String engName = factory.getEngineName();
final String engVersion = factory.getEngineVersion();
final String langName = factory.getLanguageName();
final String langVersion = factory.getLanguageVersion();
System.out.printf("\tScript Engine: %s (%s)\n", engName, engVersion);
final List<String> engNames = factory.getNames();
for (final String name: engNames) {
System.out.printf("\tEngine Alias: %s\n", name);
}
System.out.printf("\tLanguage: %s (%s)\n", langName, langVersion);
}
}
示例2: availableEngines
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
public Map<String, Map<String, Object>> availableEngines() {
Map<String, Map<String, Object>> result = new LinkedHashMap<>();
List<ScriptEngineFactory> factories = ENGINE_MANAGER.getEngineFactories();
for (ScriptEngineFactory factory : factories) {
Map<String, Object> f = new LinkedHashMap<>();
String engName = factory.getEngineName();
String engVersion = factory.getEngineVersion();
List<String> engNames = factory.getNames();
String langName = factory.getLanguageName();
String langVersion = factory.getLanguageVersion();
result.put(engName, f);
f.put("language name", langName);
f.put("language version", langVersion);
f.put("aliases", engNames);
f.put("version", engVersion);
}
return result;
}
示例3: javaInfo
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
public static void javaInfo(){
ScriptEngineManager mgr = new ScriptEngineManager();
List<ScriptEngineFactory> factories =
mgr.getEngineFactories();
for (ScriptEngineFactory factory: factories) {
System.out.println("ScriptEngineFactory Info");
String engName = factory.getEngineName();
String engVersion = factory.getEngineVersion();
String langName = factory.getLanguageName();
String langVersion = factory.getLanguageVersion();
System.out.printf("\tScript Engine: %s (%s)\n",
engName, engVersion);
List<String> engNames = factory.getNames();
for(String name: engNames) {
System.out.printf("\tEngine Alias: %s\n", name);
}
System.out.printf("\tLanguage: %s (%s)\n",
langName, langVersion);
}
}
示例4: listKnownScriptEngines
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
public void listKnownScriptEngines() {
ScriptEngineManager mgr = new ScriptEngineManager();
List<ScriptEngineFactory> factories =
mgr.getEngineFactories();
for (ScriptEngineFactory factory: factories) {
System.out.println("ScriptEngineFactory Info");
String engName = factory.getEngineName();
String engVersion = factory.getEngineVersion();
String langName = factory.getLanguageName();
String langVersion = factory.getLanguageVersion();
System.out.printf("\tScript Engine: %s (%s)\n",
engName, engVersion);
List<String> engNames = factory.getNames();
for(String name: engNames) {
System.out.printf("\tEngine Alias: %s\n", name);
}
System.out.printf("\tLanguage: %s (%s)\n",
langName, langVersion);
}
}
示例5: next
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
@Override
public Row next() {
if (!it.hasNext())
return null;
ScriptEngineFactory factory = it.next();
return new ValuesHolderRow(
rowType,
it.nextIndex(), // use nextIndex so that the IDs are 1-based
factory.getEngineName(),
factory.getEngineVersion(),
factory.getLanguageName(),
factory.getLanguageVersion(),
++rowCounter /*hidden pk*/);
}
示例6: getEngineInfo
import javax.script.ScriptEngineFactory; //导入方法依赖的package包/类
@Override
public String getEngineInfo() {
ScriptEngineFactory factory = scriptEngine.getScriptEngine().getFactory();
return factory.getEngineName() + " version " + factory.getEngineVersion();
}