org.apache.commons.betwixt.expression
Class StringExpression

java.lang.Object
  extended byorg.apache.commons.betwixt.expression.StringExpression
All Implemented Interfaces:
Expression

public class StringExpression
extends java.lang.Object
implements Expression

StringExpression returns the current context object as a string.

Version:
$Revision: 1.4 $
Author:
James Strachan

Field Summary
private static StringExpression singleton
          We only need only StringExpression
 
Constructor Summary
StringExpression()
          Base constructor.
 
Method Summary
 java.lang.Object evaluate(Context context)
          Return the context bean as a string
static StringExpression getInstance()
          Gets the singleton
 java.lang.String toString()
          Returns something useful for logging.
 void update(Context context, java.lang.String newValue)
          Do nothing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

singleton

private static final StringExpression singleton
We only need only StringExpression

Constructor Detail

StringExpression

public StringExpression()
Base constructor. Should this be private?

Method Detail

getInstance

public static StringExpression getInstance()
Gets the singleton

Returns:
the singleton StringExpression instance

evaluate

public java.lang.Object evaluate(Context context)
Return the context bean as a string

Specified by:
evaluate in interface Expression
Parameters:
context - evaluate expression against this context
Returns:
the toString() representation of the context bean

update

public void update(Context context,
                   java.lang.String newValue)
Do nothing

Specified by:
update in interface Expression
Parameters:
context - update this Context
newValue - the new value for this expression
See Also:
Expression

toString

public java.lang.String toString()
Returns something useful for logging.

Returns:
the (short) class name