org.apache.commons.betwixt.expression
Class ConstantExpression

java.lang.Object
  extended by org.apache.commons.betwixt.expression.ConstantExpression
All Implemented Interfaces:
Expression

public class ConstantExpression
extends java.lang.Object
implements Expression

ConstantExpression represents a constant expression.

In other words, evaluate(org.apache.commons.betwixt.expression.Context) returns a value independent of the context.

Version:
$Revision: 438373 $
Author:
James Strachan

Constructor Summary
ConstantExpression()
          Base constructor
ConstantExpression(java.lang.Object value)
          Convenience constructor sets value property.
 
Method Summary
 java.lang.Object evaluate(Context context)
          Evaluate expression against given context.
 java.lang.Object getValue()
          Gets the constant value of this expression
 void setValue(java.lang.Object value)
          Sets the constant value of this expression
 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
 

Constructor Detail

ConstantExpression

public ConstantExpression()
Base constructor


ConstantExpression

public ConstantExpression(java.lang.Object value)
Convenience constructor sets value property.

Parameters:
value - the Object which is the constant value for this expression
Method Detail

evaluate

public java.lang.Object evaluate(Context context)
Evaluate expression against given context.

Specified by:
evaluate in interface Expression
Parameters:
context - evaluate expression against this context
Returns:
current value of value property

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

getValue

public java.lang.Object getValue()
Gets the constant value of this expression

Returns:
this expression's constant value

setValue

public void setValue(java.lang.Object value)
Sets the constant value of this expression

Parameters:
value - the constant value for this expression

toString

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

Overrides:
toString in class java.lang.Object
Returns:
something useful for logging


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.