mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -5,8 +5,9 @@ package com.script;
|
||||
|
||||
import java.io.Reader;
|
||||
|
||||
public abstract class AbstractScriptEngine
|
||||
implements ScriptEngine {
|
||||
@SuppressWarnings("unused")
|
||||
public abstract class AbstractScriptEngine implements ScriptEngine {
|
||||
|
||||
protected ScriptContext context = new SimpleScriptContext();
|
||||
|
||||
public AbstractScriptEngine() {
|
||||
|
||||
@@ -5,8 +5,8 @@ package com.script;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface Bindings
|
||||
extends Map<String, Object> {
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
public interface Bindings extends Map<String, Object> {
|
||||
@Override
|
||||
public boolean containsKey(Object var1);
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface Bindings
|
||||
public Object put(String var1, Object var2);
|
||||
|
||||
@Override
|
||||
public void putAll(Map<? extends String, ? extends Object> var1);
|
||||
public void putAll(Map<? extends String, ?> var1);
|
||||
|
||||
@Override
|
||||
public Object remove(Object var1);
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.script;
|
||||
|
||||
import java.io.Reader;
|
||||
|
||||
@SuppressWarnings("UnnecessaryModifier")
|
||||
public interface Compilable {
|
||||
public CompiledScript compile(Reader var1) throws ScriptException;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
package com.script;
|
||||
|
||||
@SuppressWarnings({"unused", "UnnecessaryModifier"})
|
||||
public interface Invocable {
|
||||
public <T> T getInterface(Class<T> var1);
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"unused", "UnnecessaryModifier"})
|
||||
public interface ScriptContext {
|
||||
|
||||
public static final int ENGINE_SCOPE = 100;
|
||||
public static final int GLOBAL_SCOPE = 200;
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ package com.script;
|
||||
|
||||
import java.io.Reader;
|
||||
|
||||
@SuppressWarnings({"unused", "UnnecessaryModifier"})
|
||||
public interface ScriptEngine {
|
||||
public static final String FILENAME = "javax.script.filename";
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
*/
|
||||
package com.script;
|
||||
|
||||
public class ScriptException
|
||||
extends Exception {
|
||||
@SuppressWarnings("unused")
|
||||
public class ScriptException extends Exception {
|
||||
private int columnNumber;
|
||||
private String fileName;
|
||||
private int lineNumber;
|
||||
|
||||
@@ -8,8 +8,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class SimpleBindings
|
||||
implements Bindings {
|
||||
public class SimpleBindings implements Bindings {
|
||||
private Map<String, Object> map;
|
||||
|
||||
public SimpleBindings(Map<String, Object> m) {
|
||||
|
||||
@@ -11,8 +11,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class SimpleScriptContext
|
||||
implements ScriptContext {
|
||||
public class SimpleScriptContext implements ScriptContext {
|
||||
private static List<Integer> scopes = new ArrayList<Integer>(2);
|
||||
protected Bindings engineScope = new SimpleBindings();
|
||||
protected Writer errorWriter = new PrintWriter(System.err, true);
|
||||
|
||||
Reference in New Issue
Block a user