@Test public void testRunScript() { scriptHandler.register(new TestScriptRunner()); assertEquals(1, scriptHandler.runScript(ScriptFragment.of("fortest"))); }
@Override public Object runScript(ScriptFragment scriptFragment) { ScriptRunner process = get(scriptFragment); if (process == null) { throw new IllegalArgumentException("can not find ScriptRunner for " + scriptFragment.toScriptString()); } return process.run(scriptFragment); }
DefaultScriptHandler implements ScriptHandler { @Override public Object runScript(ScriptFragment scriptFragment) { ScriptRunner process = get(scriptFragment); if (process == null) { throw new IllegalArgumentException("can not find ScriptRunner for " + scriptFragment.toScriptString()); } return process.run(scriptFragment); } }
DefaultScriptHandler implements ScriptHandler { @Override public Object runScript(ScriptFragment scriptFragment) { ScriptRunner process = get(scriptFragment); if (process == null) { throw new IllegalArgumentException("can not find ScriptRunner for " + scriptFragment.toScriptString()); } return process.run(scriptFragment); } DefaultScriptHandler(); }
DefaultScriptHandler implements ScriptHandler { @Override public Object runScript(ScriptFragment scriptFragment) { ScriptRunner process = get(scriptFragment); if (process == null) { throw new IllegalArgumentException("can not find ScriptRunner for " + scriptFragment.toScriptString()); } return process.run(scriptFragment); } DefaultScriptHandler(); @Override Object runScript(ScriptFragment scriptFragment); @Override void register(ScriptRunnerModule scriptRunnerModule); @Override void register(ScriptRunner scriptRunner); ScriptRunner get(ScriptFragment scriptFragment); }
DefaultScriptHandler implements ScriptHandler { @Override public Object runScript(ScriptFragment scriptFragment) { ScriptRunner process = get(scriptFragment); if (process == null) { throw new IllegalArgumentException("can not find ScriptRunner for " + scriptFragment.toScriptString()); } return process.run(scriptFragment); } DefaultScriptHandler(); @Override Object runScript(ScriptFragment scriptFragment); @Override void register(ScriptRunnerModule scriptRunnerModule); @Override void register(ScriptRunner scriptRunner); ScriptRunner get(ScriptFragment scriptFragment);  }