Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Extraire les MetataData des Moteurs de Script


{filelink=954}

 
import java.util.List;
 
import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;
 
public class JSMetadata {
  public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    List<ScriptEngineFactory> factories = manager.getEngineFactories();
    for (ScriptEngineFactory factory : factories) {
      System.out.println("Le nom Complet du moteur = " + factory.getEngineName());
      System.out.println("Version = " + factory.getEngineVersion());
      System.out.println("Version de java supportée = " + factory.getLanguageVersion());
      System.out.println("Extension = " + factory.getExtensions());
      System.out.println("Type MIME = " + factory.getMimeTypes());
      System.out.println("Le Moteur = " + factory.getScriptEngine());
    }
  }
}
/*
Le nom Complet du moteur = Mozilla Rhino
Version = 1.6 release 2
Version de java supportée = 1.6
Extension = [js]
Type MIME = [application/javascript, application/ecmascript, text/javascript, text/ecmascript]
Le Moteur = com.sun.script.javascript.RhinoScriptEngine@1815859
 
*/