org.aitools.programd.interpreter
Class RhinoInterpreter

java.lang.Object
  extended by org.aitools.programd.interpreter.RhinoInterpreter
All Implemented Interfaces:
Interpreter

public class RhinoInterpreter
extends java.lang.Object
implements Interpreter

An implementation of Interpreter that handles server-side JavaScript using the Rhino package.

Author:
Jon Baer, Noel Bush

Field Summary
private static java.lang.String CMD
          The string "<cmd>".
private static java.lang.String EMPTY_STRING
          An empty string.
private static java.lang.String LINE_SEPARATOR
          The system line separator.
private static org.apache.log4j.Logger logger
          The logger.
 
Constructor Summary
RhinoInterpreter()
           
 
Method Summary
 java.lang.String evaluate(java.lang.String expression)
          Evaluates a given JavaScript expression for a given userid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD

private static final java.lang.String CMD
The string "<cmd>".

See Also:
Constant Field Values

EMPTY_STRING

private static final java.lang.String EMPTY_STRING
An empty string.

See Also:
Constant Field Values

LINE_SEPARATOR

private static final java.lang.String LINE_SEPARATOR
The system line separator.


logger

private static final org.apache.log4j.Logger logger
The logger.

Constructor Detail

RhinoInterpreter

public RhinoInterpreter()
Method Detail

evaluate

public java.lang.String evaluate(java.lang.String expression)
Description copied from interface: Interpreter
Evaluates a given JavaScript expression for a given userid.

Specified by:
evaluate in interface Interpreter
Parameters:
expression - the expression to evaluate
Returns:
the result of evaluating the expression
See Also:
Interpreter.evaluate(java.lang.String)