mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-15 07:18:34 +00:00
Improved scripting support.
This commit is contained in:
@ -31,10 +31,10 @@ import com.sk89q.worldedit.UnknownItemException;
|
||||
import com.sk89q.worldedit.WorldEditController;
|
||||
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||
|
||||
public class ScriptContext extends ScriptEnvironment {
|
||||
public class CraftScriptContext extends CraftScriptEnvironment {
|
||||
private List<EditSession> editSessions = new ArrayList<EditSession>();
|
||||
|
||||
public ScriptContext(WorldEditController controller,
|
||||
public CraftScriptContext(WorldEditController controller,
|
||||
ServerInterface server, LocalConfiguration config,
|
||||
LocalSession session, LocalPlayer player) {
|
||||
super(controller, server, config, session, player);
|
30
src/com/sk89q/worldedit/scripting/CraftScriptEngine.java
Normal file
30
src/com/sk89q/worldedit/scripting/CraftScriptEngine.java
Normal file
@ -0,0 +1,30 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
public interface CraftScriptEngine {
|
||||
public void setTimeLimit(int milliseconds);
|
||||
public int getTimeLimit();
|
||||
public Object evaluate(String script, String filename, Map<String, Object> args)
|
||||
throws ScriptException;
|
||||
}
|
@ -25,14 +25,14 @@ import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.ServerInterface;
|
||||
import com.sk89q.worldedit.WorldEditController;
|
||||
|
||||
public abstract class ScriptEnvironment {
|
||||
public abstract class CraftScriptEnvironment {
|
||||
protected WorldEditController controller;
|
||||
protected LocalPlayer player;
|
||||
protected LocalConfiguration config;
|
||||
protected LocalSession session;
|
||||
protected ServerInterface server;
|
||||
|
||||
public ScriptEnvironment(WorldEditController controller, ServerInterface server,
|
||||
public CraftScriptEnvironment(WorldEditController controller, ServerInterface server,
|
||||
LocalConfiguration config, LocalSession session, LocalPlayer player) {
|
||||
this.controller = controller;
|
||||
this.player = player;
|
61
src/com/sk89q/worldedit/scripting/RhinoContextFactory.java
Normal file
61
src/com/sk89q/worldedit/scripting/RhinoContextFactory.java
Normal file
@ -0,0 +1,61 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import org.mozilla.javascript.*;
|
||||
|
||||
public class RhinoContextFactory extends ContextFactory {
|
||||
protected int timeLimit;
|
||||
|
||||
public RhinoContextFactory(int timeLimit) {
|
||||
this.timeLimit = timeLimit;
|
||||
}
|
||||
|
||||
protected Context makeContext() {
|
||||
RhinoContext cx = new RhinoContext(this);
|
||||
cx.setInstructionObserverThreshold(10000);
|
||||
return cx;
|
||||
}
|
||||
|
||||
protected void observeInstructionCount(Context cx, int instructionCount) {
|
||||
RhinoContext mcx = (RhinoContext)cx;
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
if (currentTime - mcx.startTime > timeLimit) {
|
||||
throw new Error("Script timed out (" + timeLimit + "ms)");
|
||||
}
|
||||
}
|
||||
|
||||
protected Object doTopCall(Callable callable, Context cx, Scriptable scope,
|
||||
Scriptable thisObj, Object[] args) {
|
||||
RhinoContext mcx = (RhinoContext)cx;
|
||||
mcx.startTime = System.currentTimeMillis();
|
||||
|
||||
return super.doTopCall(callable, cx, scope, thisObj, args);
|
||||
}
|
||||
|
||||
private static class RhinoContext extends Context {
|
||||
long startTime;
|
||||
|
||||
public RhinoContext(ContextFactory factory) {
|
||||
super(factory);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.script.ScriptException;
|
||||
import org.mozilla.javascript.*;
|
||||
|
||||
public class RhinoCraftScriptEngine implements CraftScriptEngine {
|
||||
private int timeLimit;
|
||||
|
||||
@Override
|
||||
public void setTimeLimit(int milliseconds) {
|
||||
timeLimit = milliseconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTimeLimit() {
|
||||
return timeLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object evaluate(String script, String filename, Map<String, Object> args)
|
||||
throws ScriptException {
|
||||
RhinoContextFactory factory = new RhinoContextFactory(timeLimit);
|
||||
Context cx = factory.enterContext();
|
||||
ScriptableObject scriptable = new ImporterTopLevel(cx);
|
||||
Scriptable scope = cx.initStandardObjects(scriptable);
|
||||
|
||||
for (Map.Entry<String, Object> entry : args.entrySet()) {
|
||||
ScriptableObject.putProperty(scope, entry.getKey(),
|
||||
Context.javaToJS(entry.getValue(), scope));
|
||||
}
|
||||
try {
|
||||
return cx.evaluateString(scope, script, filename, 1, null);
|
||||
} catch (Error e) {
|
||||
throw new ScriptException(e.getMessage());
|
||||
} catch (RhinoException e) {
|
||||
String msg;
|
||||
int line = (line = e.lineNumber()) == 0 ? -1 : line;
|
||||
|
||||
if (e instanceof JavaScriptException) {
|
||||
msg = String.valueOf(((JavaScriptException)e).getValue());
|
||||
} else {
|
||||
msg = e.getMessage();
|
||||
}
|
||||
|
||||
ScriptException scriptException =
|
||||
new ScriptException(msg, e.sourceName(), line);
|
||||
scriptException.initCause(e);
|
||||
|
||||
throw scriptException;
|
||||
} finally {
|
||||
Context.exit();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import sun.org.mozilla.javascript.internal.*;
|
||||
|
||||
public class SunRhinoContextFactory extends ContextFactory {
|
||||
protected int timeLimit;
|
||||
|
||||
public SunRhinoContextFactory(int timeLimit) {
|
||||
this.timeLimit = timeLimit;
|
||||
}
|
||||
|
||||
protected Context makeContext() {
|
||||
RhinoContext cx = new RhinoContext(this);
|
||||
cx.setInstructionObserverThreshold(10000);
|
||||
return cx;
|
||||
}
|
||||
|
||||
protected void observeInstructionCount(Context cx, int instructionCount) {
|
||||
RhinoContext mcx = (RhinoContext)cx;
|
||||
long currentTime = System.currentTimeMillis();
|
||||
|
||||
if (currentTime - mcx.startTime > timeLimit) {
|
||||
throw new Error("Script timed out (" + timeLimit + "ms)");
|
||||
}
|
||||
}
|
||||
|
||||
protected Object doTopCall(Callable callable, Context cx, Scriptable scope,
|
||||
Scriptable thisObj, Object[] args) {
|
||||
RhinoContext mcx = (RhinoContext)cx;
|
||||
mcx.startTime = System.currentTimeMillis();
|
||||
|
||||
return super.doTopCall(callable, cx, scope, thisObj, args);
|
||||
}
|
||||
|
||||
private static class RhinoContext extends Context {
|
||||
long startTime;
|
||||
|
||||
public RhinoContext(ContextFactory factory) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import java.util.Map;
|
||||
import javax.script.ScriptException;
|
||||
import com.sk89q.worldedit.WorldEditController;
|
||||
import sun.org.mozilla.javascript.internal.*;
|
||||
|
||||
public class SunRhinoCraftScriptEngine implements CraftScriptEngine {
|
||||
private int timeLimit;
|
||||
|
||||
@Override
|
||||
public void setTimeLimit(int milliseconds) {
|
||||
timeLimit = milliseconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTimeLimit() {
|
||||
return timeLimit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object evaluate(final String script, final String filename,
|
||||
final Map<String, Object> args)
|
||||
throws ScriptException {
|
||||
SunRhinoContextFactory factory = new SunRhinoContextFactory(timeLimit);
|
||||
factory.initApplicationClassLoader(WorldEditController.class.getClassLoader());
|
||||
|
||||
try {
|
||||
return factory.call(new ContextAction() {
|
||||
public Object run(Context cx) {
|
||||
Scriptable topLevel = new ImporterTopLevel(cx);
|
||||
Scriptable scope = cx.initStandardObjects();
|
||||
topLevel.setParentScope(scope);
|
||||
|
||||
for (Map.Entry<String, Object> entry : args.entrySet()) {
|
||||
ScriptableObject.putProperty(scope, entry.getKey(),
|
||||
Context.javaToJS(entry.getValue(), scope));
|
||||
}
|
||||
|
||||
return cx.evaluateString(topLevel, script, filename, 1, null);
|
||||
}
|
||||
});
|
||||
} catch (Error e) {
|
||||
throw new ScriptException(e.getMessage());
|
||||
} catch (RhinoException e) {
|
||||
String msg;
|
||||
int line = (line = e.lineNumber()) == 0 ? -1 : line;
|
||||
|
||||
if (e instanceof JavaScriptException) {
|
||||
msg = String.valueOf(((JavaScriptException)e).getValue());
|
||||
} else {
|
||||
msg = e.getMessage();
|
||||
}
|
||||
|
||||
ScriptException scriptException =
|
||||
new ScriptException(msg, e.sourceName(), line);
|
||||
scriptException.initCause(e);
|
||||
|
||||
throw scriptException;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
119
src/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java
Normal file
119
src/com/sk89q/worldedit/scripting/java/RhinoScriptEngine.java
Normal file
@ -0,0 +1,119 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting.java;
|
||||
|
||||
import java.io.*;
|
||||
import javax.script.*;
|
||||
import org.mozilla.javascript.*;
|
||||
import com.sk89q.worldedit.scripting.RhinoContextFactory;
|
||||
|
||||
public class RhinoScriptEngine extends AbstractScriptEngine {
|
||||
private ScriptEngineFactory factory;
|
||||
private Context cx;
|
||||
|
||||
public RhinoScriptEngine() {
|
||||
RhinoContextFactory factory = new RhinoContextFactory(3000);
|
||||
factory.enterContext();
|
||||
}
|
||||
|
||||
public Bindings createBindings() {
|
||||
return new SimpleBindings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object eval(String script, ScriptContext context)
|
||||
throws ScriptException {
|
||||
|
||||
Scriptable scope = setupScope(cx, context);
|
||||
|
||||
String filename = (filename = (String)get(ScriptEngine.FILENAME)) == null
|
||||
? "<unknown>" : filename;
|
||||
|
||||
try {
|
||||
return cx.evaluateString(scope, script, filename, 1, null);
|
||||
} catch (RhinoException e) {
|
||||
String msg;
|
||||
int line = (line = e.lineNumber()) == 0 ? -1 : line;
|
||||
|
||||
if (e instanceof JavaScriptException) {
|
||||
msg = String.valueOf(((JavaScriptException)e).getValue());
|
||||
} else {
|
||||
msg = e.getMessage();
|
||||
}
|
||||
|
||||
ScriptException scriptException =
|
||||
new ScriptException(msg, e.sourceName(), line);
|
||||
scriptException.initCause(e);
|
||||
|
||||
throw scriptException;
|
||||
} finally {
|
||||
Context.exit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object eval(Reader reader, ScriptContext context)
|
||||
throws ScriptException {
|
||||
|
||||
Scriptable scope = setupScope(cx, context);
|
||||
|
||||
String filename = (filename = (String)get(ScriptEngine.FILENAME)) == null
|
||||
? "<unknown>" : filename;
|
||||
|
||||
try {
|
||||
return cx.evaluateReader(scope, reader, filename, 1, null);
|
||||
} catch (RhinoException e) {
|
||||
String msg;
|
||||
int line = (line = e.lineNumber()) == 0 ? -1 : line;
|
||||
|
||||
if (e instanceof JavaScriptException) {
|
||||
msg = String.valueOf(((JavaScriptException)e).getValue());
|
||||
} else {
|
||||
msg = e.getMessage();
|
||||
}
|
||||
|
||||
ScriptException scriptException =
|
||||
new ScriptException(msg, e.sourceName(), line);
|
||||
scriptException.initCause(e);
|
||||
|
||||
throw scriptException;
|
||||
} catch (IOException e) {
|
||||
throw new ScriptException(e);
|
||||
} finally {
|
||||
Context.exit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptEngineFactory getFactory() {
|
||||
if (factory != null) {
|
||||
return factory;
|
||||
} else {
|
||||
return new RhinoScriptEngineFactory();
|
||||
}
|
||||
}
|
||||
|
||||
private Scriptable setupScope(Context cx, ScriptContext context) {
|
||||
ScriptableObject scriptable = new ImporterTopLevel(cx);
|
||||
Scriptable scope = cx.initStandardObjects(scriptable);
|
||||
//ScriptableObject.putProperty(scope, "argv", Context.javaToJS(args, scope));
|
||||
return scope;
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
// $Id$
|
||||
/*
|
||||
* WorldEdit
|
||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.scripting.java;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineFactory;
|
||||
|
||||
public class RhinoScriptEngineFactory implements ScriptEngineFactory {
|
||||
private static List<String> names;
|
||||
private static List<String> mimeTypes;
|
||||
private static List<String> extensions;
|
||||
|
||||
static {
|
||||
names = new ArrayList<String>(5);
|
||||
names.add("ECMAScript");
|
||||
names.add("ecmascript");
|
||||
names.add("JavaScript");
|
||||
names.add("javascript");
|
||||
names.add("js");
|
||||
names = Collections.unmodifiableList(names);
|
||||
|
||||
mimeTypes = new ArrayList<String>(4);
|
||||
mimeTypes.add("application/ecmascript");
|
||||
mimeTypes.add("text/ecmascript");
|
||||
mimeTypes.add("application/javascript");
|
||||
mimeTypes.add("text/javascript");
|
||||
mimeTypes = Collections.unmodifiableList(mimeTypes);
|
||||
|
||||
extensions = new ArrayList<String>(2);
|
||||
extensions.add("emcascript");
|
||||
extensions.add("js");
|
||||
extensions = Collections.unmodifiableList(extensions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEngineName() {
|
||||
return "Rhino JavaScript Engine (SK)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEngineVersion() {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getExtensions() {
|
||||
return extensions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLanguageName() {
|
||||
return "EMCAScript";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLanguageVersion() {
|
||||
return "1.8";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMethodCallSyntax(String obj, String m, String ... args) {
|
||||
StringBuilder s = new StringBuilder();
|
||||
s.append(obj);
|
||||
s.append(".");
|
||||
s.append(m);
|
||||
s.append("(");
|
||||
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
s.append(args[i]);
|
||||
if (i < args.length - 1) {
|
||||
s.append(",");
|
||||
}
|
||||
}
|
||||
|
||||
s.append(")");
|
||||
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMimeTypes() {
|
||||
return mimeTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNames() {
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOutputStatement(String str) {
|
||||
return "print(" + str.replace("\\", "\\\\")
|
||||
.replace("\"", "\\\\\"")
|
||||
.replace(";", "\\\\;") + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getParameter(String key) {
|
||||
if (key.equals(ScriptEngine.ENGINE)) {
|
||||
return getEngineName();
|
||||
} else if (key.equals(ScriptEngine.ENGINE_VERSION)) {
|
||||
return getEngineVersion();
|
||||
} else if (key.equals(ScriptEngine.NAME)) {
|
||||
return getEngineName();
|
||||
} else if (key.equals(ScriptEngine.LANGUAGE)) {
|
||||
return getLanguageName();
|
||||
} else if (key.equals(ScriptEngine.LANGUAGE_VERSION)) {
|
||||
return getLanguageVersion();
|
||||
} else if (key.equals("THREADING")) {
|
||||
return "MULTITHREADED";
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid key");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getProgram(String ... statements) {
|
||||
StringBuilder s = new StringBuilder();
|
||||
for (String stmt : statements) {
|
||||
s.append(stmt);
|
||||
s.append(";");
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScriptEngine getScriptEngine() {
|
||||
return new RhinoScriptEngine();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user