public class

VariableExpression

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

Class Overview

VariableExpression represents a variable expression such as $foo which returns the value of the given variable.

Summary

Public Constructors
VariableExpression()
Base constructor
VariableExpression(String variableName)
Convenience constructor sets VariableName property
Public Methods
Object evaluate(Context context)
Return the value of a context variable.
String getVariableName()
Gets the variable name
void setVariableName(String variableName)
Sets the variable name
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 VariableExpression ()

Base constructor

public VariableExpression (String variableName)

Convenience constructor sets VariableName property

Parameters
variableName the name of the context variable whose value will be returned by an evaluation

Public Methods

public Object evaluate (Context context)

Return the value of a context variable.

Parameters
context evaluate against this context
Returns
  • the value of the context variable named by the VariableName property

public String getVariableName ()

Gets the variable name

Returns
  • the name of the context variable whose value will be returned by an evaluation

public void setVariableName (String variableName)

Sets the variable name

Parameters
variableName the name of the context variable whose value will be returned by an evaluation

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