public class

ConstantExpression

extends Object
implements Expression
java.lang.Object
   ↳ org.apache.commons.betwixt.expression.ConstantExpression

Class Overview

ConstantExpression represents a constant expression.

In other words, evaluate(Context) returns a value independent of the context.

Summary

Public Constructors
ConstantExpression()
Base constructor
ConstantExpression(Object value)
Convenience constructor sets value property.
Public Methods
Object evaluate(Context context)
Evaluate expression against given context.
Object getValue()
Gets the constant value of this expression
void setValue(Object value)
Sets the constant value of this expression
String toString()
Returns something useful for logging
void update(Context context, String newValue)
Do nothing
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.commons.betwixt.expression.Expression

Public Constructors

public ConstantExpression ()

Base constructor

public ConstantExpression (Object value)

Convenience constructor sets value property.

Parameters
value the Object which is the constant value for this expression

Public Methods

public Object evaluate (Context context)

Evaluate expression against given context.

Parameters
context evaluate expression against this context
Returns
  • current value of value property

public Object getValue ()

Gets the constant value of this expression

Returns
  • this expression's constant value

public void setValue (Object value)

Sets the constant value of this expression

Parameters
value the constant value for this expression

public String toString ()

Returns something useful for logging

Returns
  • something useful for logging

public void update (Context context, String newValue)

Do nothing

Parameters
context update this Context
newValue the new value for this expression
See Also