ScriptEngineManager: getEngineByMimeType(String mimeType) : ScriptEngineManager « javax.script « Java by API






ScriptEngineManager: getEngineByMimeType(String mimeType)

   

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class Main{
  public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine jsEngine = manager.getEngineByMimeType("text/javascript");
    if (!(jsEngine == null)) {
      System.out.println("text/javascript MIME type retrieved:" + jsEngine);
    }
    ScriptEngine jsEngine2 = manager.getEngineByMimeType("text/vbscript");
    if (jsEngine2 == null)
      System.out.println("\nNo supported script engine found for text/vbscript MIME type.");
  }
}

   
    
    
  








Related examples in the same category

1.new ScriptEngineManager()
2.ScriptEngineManager: getEngineByName(String shortName)