org.norther.tammi.core.scripter.djava
Class DJavaInterpreter

java.lang.Object
  extended by koala.dynamicjava.interpreter.TreeInterpreter
      extended by koala.dynamicjava.interpreter.WeakInterpreter
          extended by org.norther.tammi.core.scripter.djava.DJavaInterpreter
All Implemented Interfaces:
koala.dynamicjava.interpreter.Interpreter

public class DJavaInterpreter
extends koala.dynamicjava.interpreter.WeakInterpreter
implements Interpreter

A DJava interpreter.

Version:
$Id: DJavaInterpreter.java,v 1.8 2009/09/28 15:08:46 cvsimp Exp $
Author:
Ilkka Priha

Field Summary
 
Fields inherited from class koala.dynamicjava.interpreter.TreeInterpreter
accessible, checkVisitorContext, classLoader, constructorParameters, evalVisitorContext, libraryFinder, methods, nameVisitorContext, nClass, parserFactory
 
Fields inherited from interface org.norther.tammi.core.scripter.lang.Interpreter
JAVA_LANGUAGE
 
Constructor Summary
DJavaInterpreter(koala.dynamicjava.parser.wrapper.ParserFactory pf)
          Creates a new interpreter.
DJavaInterpreter(koala.dynamicjava.parser.wrapper.ParserFactory pf, ClassLoader cl)
          Creates a new interpreter with a class loader.
 
Method Summary
 Object interpret(File file)
          Interprets a file.
 Object interpret(String s, String fname)
          Interprets a string.
 Object interpret(URL url)
          Interprets a URL.
 
Methods inherited from class koala.dynamicjava.interpreter.WeakInterpreter
addClassPath, addClassURL, buildStatementList, defineClass, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, defineVariable, finalize, getClassLoader, getClassNames, getVariable, getVariableClass, getVariableNames, interpret, interpret, interpret, interpretArguments, interpretLocalArguments, invokeLocalMethod, invokeMethod, isDefined, parseStatementList, registerConstructorArguments, registerMethod, reset, setAccessible, setVariable
 
Methods inherited from class koala.dynamicjava.interpreter.TreeInterpreter
addLibraryPath, addLibrarySuffix, defineVariable, getAccessible, getExceptionClass, getLibraryFinder, getParserFactory, interpret, interpretArguments, interpretMethod, loadClass
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.scripter.lang.Interpreter
addClassPath, addClassURL, defineClass, defineVariable, defineVariable, getClassLoader, getClassNames, getVariable, getVariableClass, getVariableNames, interpret, interpret, isDefined, loadClass, reset, setVariable
 

Constructor Detail

DJavaInterpreter

public DJavaInterpreter(koala.dynamicjava.parser.wrapper.ParserFactory pf)
Creates a new interpreter.

Parameters:
pf - the parser factory.

DJavaInterpreter

public DJavaInterpreter(koala.dynamicjava.parser.wrapper.ParserFactory pf,
                        ClassLoader cl)
Creates a new interpreter with a class loader.

Parameters:
pf - the parser factory.
cl - the auxiliary class loader used to load external classes.
Method Detail

interpret

public Object interpret(String s,
                        String fname)
Description copied from interface: Interpreter
Interprets a string.

Parameters:
s - the string from which the statements are read.
fname - the name of the parsed string.
Returns:
the result of the evaluation of the last statement.

interpret

public Object interpret(File file)
                 throws IOException
Description copied from interface: Interpreter
Interprets a file.

Parameters:
file - the file to interpret.
Returns:
the result of the evaluation of the last statement.
Throws:
IOException - on I/O errors.

interpret

public Object interpret(URL url)
                 throws IOException
Description copied from interface: Interpreter
Interprets a URL.

Parameters:
url - the url to interpret.
Returns:
the result of the evaluation of the last statement.
Throws:
IOException - on I/O errors.


Copyright © 2004 The Norther Organization. All rights reserved.