List of utility methods to do Script Engine
CompiledScript | compile(ScriptEngine engine, String script) compile if (engine instanceof Compilable) { Compilable compEngine = (Compilable) engine; return compEngine.compile(script); return null; |
ScriptEngine | createNashornEngine() create Nashorn Engine return s_aScriptFactory.getEngineByName("nashorn"); |
Object | evaluateScriptResource(ScriptEngine engine, String resource) evaluate Script Resource String script = getScriptResource(resource);
return engine.eval(script);
|
ScriptEngine | getAppleScriptEngine() Obtiene el motor de script AppleScript .
final ScriptEngine se = new ScriptEngineManager().getEngineByName("AppleScriptEngine"); if (se != null) { return se; return new ScriptEngineManager().getEngineByName("AppleScript"); |
List
| getAvailableEngineGroups() get Available Engine Groups List<List<String>> availableNames = new Vector<List<String>>(); ScriptEngineManager manager = new ScriptEngineManager(); List<ScriptEngineFactory> factories = manager.getEngineFactories(); for (ScriptEngineFactory factory : factories) { availableNames.add(factory.getNames()); return availableNames; |
ScriptEngineManager | getDefaultScriptEngineManager() get Default Script Engine Manager return DEFAULT_SCRIPT_ENGINE_MANAGER;
|
ScriptEngine | getEngine() get Engine return engine;
|
ScriptEngine | getEngine(String engineName) get Engine if (engineName != null) { ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName(engineName); if (engine != null) { return engine; engine = factory.getEngineByExtension(engineName); if (engine != null) { ... |
ScriptEngine | getScriptEngine() get Script Engine long id = Thread.currentThread().getId(); ScriptEngine engine = context.get(id); if (engine == null) { ScriptEngineManager engineManager = new ScriptEngineManager(); engine = engineManager.getEngineByName("nashorn"); context.put(id, engine); return engine; ... |
ScriptEngine | getScriptEngine(final ClassLoader loader, final String... args) get Script Engine return FACTORY.getScriptEngine(args, loader);
|