Java Script Engine listScriptEngines()

Here you can find the source of listScriptEngines()

Description

list Script Engines

License

Apache License

Declaration

public static void listScriptEngines() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.List;
import javax.script.*;

public class Main {
    public static void listScriptEngines() {
        ScriptEngineManager mgr = new ScriptEngineManager();
        List<ScriptEngineFactory> factories = mgr.getEngineFactories();
        int num = 0;
        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((++num) + ". Script Engine: %s (%s)%n", engName, engVersion);

            List<String> engNames = factory.getNames();
            for (String name : engNames) {
                System.out.printf("\tEngine Alias: %s%n", name);
            }//from  w  w w .j a v  a 2  s  .  c  om

            System.out.printf("\tLanguage: %s (%s)%n", langName, langVersion);

        }

    }
}

Related

  1. getStringOrExcept(ScriptEngine e, String vname)
  2. getVersionString(ScriptEngineFactory factory)
  3. importClass(ScriptEngine e, Class pkg, Bindings... b)
  4. isJsEngineAvailable(String engineName, Logger logger)
  5. listGems(ScriptEngine jruby)
  6. registerFactoryToManager(ScriptEngineFactory factory, ScriptEngineManager scriptEngineManager)
  7. retrieveEngineByName(ScriptEngineManager scriptEngineManager, String engineName)
  8. scriptEngine(String epStr, Map per)
  9. showEngineList()