|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.scripter.lang.AbstractEngine
org.norther.tammi.core.scripter.lang.AbstractInterpreter
public abstract class AbstractInterpreter
An abstract interpreter adapter for BSF engines.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.scripter.lang.AbstractEngine |
|---|
CLASS_PATH_SEPARATOR_EXPR |
| Fields inherited from interface org.norther.tammi.core.scripter.lang.Interpreter |
|---|
JAVA_LANGUAGE |
| Fields inherited from interface org.norther.tammi.core.scripter.lang.ScriptEngine |
|---|
APPLY, ARGUMENTS, EVALUATE, EXECUTE, MAIN |
| Constructor Summary | |
|---|---|
AbstractInterpreter()
Constructs a new interpreter. |
|
| Method Summary | |
|---|---|
void |
addClassPath(String path)
Adds a class search path. |
void |
addClassURL(URL url)
Adds a class search URL. |
Class |
defineClass(String name,
byte[] code)
Converts an array of bytes into a class. |
void |
defineVariable(String name,
Object value)
Defines a variable in the interpreter environment. |
void |
defineVariable(String name,
Object value,
Class c)
Defines a variable of the specified class. |
ClassLoader |
getClassLoader()
Gets the class loader. |
Set |
getClassNames()
Gets the defined class names. |
protected abstract Interpreter |
getInterpreter()
Gets the adapted interpreter. |
Object |
getVariable(String name)
Gets the value of a variable. |
Class |
getVariableClass(String name)
Gets the class of a variable. |
Set |
getVariableNames()
Gets the defined variable names. |
Object |
interpret(File file)
Interprets a file. |
Object |
interpret(InputStream in,
String fname)
Interprets an input stream. |
Object |
interpret(Reader r,
String fname)
Interprets a reader. |
Object |
interpret(String s,
String fname)
Interprets a string. |
Object |
interpret(URL url)
Interprets a URL. |
boolean |
isDefined(String name)
Checks whether a variable is defined. |
Class |
loadClass(String name)
Loads an interpreted class. |
void |
reset()
Resets this interpreter. |
void |
setVariable(String name,
Object value)
Sets the value of a variable. |
| Methods inherited from class org.norther.tammi.core.scripter.lang.AbstractEngine |
|---|
compileApply, compileExpr, compileScript, disconnectedDebuggerNotify, getClassPath, getDebugManager, getDeclaredBeans, getInitializer, getLanguage, getSpecificDebuggingInterface, getTempDirectory, initialize, isInitialized, placeBreakpointAtLine, placeBreakpointAtOffset, propertyChange, reinitialize, removeBreakpoint, setClassLoader, setClassPath, setEntryExit, setInitializer, setTempDirectory, terminate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.bsf.BSFEngine |
|---|
apply, call, declareBean, eval, exec, undeclareBean |
| Constructor Detail |
|---|
public AbstractInterpreter()
| Method Detail |
|---|
public Object interpret(String s,
String fname)
Interpreter
interpret in interface Interpreters - the string from which the statements are read.fname - the name of the parsed string.
public Object interpret(InputStream in,
String fname)
Interpreter
interpret in interface Interpreterin - the input stream from which the statements are read.fname - the name of the parsed stream.
public Object interpret(Reader r,
String fname)
Interpreter
interpret in interface Interpreterr - the reader.fname - the name of the parsed stream.
public Object interpret(File file)
throws IOException
Interpreter
interpret in interface Interpreterfile - the file to interpret.
IOException - on I/O errors.
public Object interpret(URL url)
throws IOException
Interpreter
interpret in interface Interpreterurl - the url to interpret.
IOException - on I/O errors.
public void defineVariable(String name,
Object value)
Interpreter
defineVariable in interface Interpretername - the variable's name.value - the initial value of the variable.
public void defineVariable(String name,
Object value,
Class c)
Interpreter
defineVariable in interface Interpretername - the name.value - the value.c - the class.public boolean isDefined(String name)
Interpreter
isDefined in interface Interpretername - the name.
public Object getVariable(String name)
Interpreter
getVariable in interface Interpretername - the variable name.
public void setVariable(String name,
Object value)
Interpreter
setVariable in interface Interpretername - the variable name.value - the value of the variable.public Class getVariableClass(String name)
Interpreter
getVariableClass in interface Interpretername - the variable name.
public Set getVariableNames()
Interpreter
getVariableNames in interface Interpreterpublic void addClassPath(String path)
Interpreter
addClassPath in interface Interpreterpath - the path to add.public void addClassURL(URL url)
Interpreter
addClassURL in interface Interpreterurl - the url to add.
public Class loadClass(String name)
throws ClassNotFoundException
Interpreter
loadClass in interface Interpretername - the fully qualified name of the class to load.
ClassNotFoundException - if the class cannot be find.
public Class defineClass(String name,
byte[] code)
Interpreter
defineClass in interface Interpretername - the fully qualified name of the class to load.code - the byte code of the class.
public Set getClassNames()
Interpreter
getClassNames in interface Interpreterpublic ClassLoader getClassLoader()
AbstractEngine
getClassLoader in interface InterpretergetClassLoader in class AbstractEnginepublic void reset()
Interpreter
reset in interface Interpreterprotected abstract Interpreter getInterpreter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||