org.specrunner.expressions.core
Class ExpressionVariable
java.lang.Object
org.specrunner.expressions.core.AbstractExpression
org.specrunner.expressions.core.ExpressionVariable
- All Implemented Interfaces:
- IExpression
public class ExpressionVariable
- extends AbstractExpression
Expression variable. Lookup by variable name in the context using
getByName(<name>) method.
- Author:
- Thiago Santos
|
Field Summary |
protected String |
name
The variable name. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected String name
- The variable name.
ExpressionVariable
public ExpressionVariable(IExpressionFactory parent,
String name)
- Creates an expression to access a variable.
- Parameters:
parent - The expression factory.name - The variable name.
getName
public String getName()
- Gets the variable name.
- Returns:
- The name.
setName
public void setName(String name)
- Sets the variable name.
- Parameters:
name - The name.
evaluate
public Object evaluate(IContext context,
boolean silent)
throws ExpressionException
- Description copied from interface:
IExpression
- Given a context, evaluates the expression.
- Parameters:
context - A contextual information.silent - true, for evaluation without exceptions,
false, otherwise.
- Returns:
- The result of expression evaluation.
- Throws:
ExpressionException - On evaluation errors.
Copyright © 2014. All rights reserved.