org.josql.expressions
Class ValueExpression
java.lang.Object
org.josql.expressions.Expression
org.josql.expressions.ValueExpression
- Direct Known Subclasses:
- Accessor, ArithmeticExpression, BindVariable, BooleanExpression, ConstantExpression, ExpressionList, Function, NewObjectExpression, SaveValue, SubQueryExpression
public abstract class ValueExpression
- extends Expression
ValueExpression
public ValueExpression()
getValue
public Object getValue(Object o,
Query q)
throws QueryExecutionException
- Description copied from class:
Expression
- Get the value for this expression based upon the object passed in. In general
sub-classes should perform some operation on the object to generate their result.
The Query object is provided so that sub-classes can gain access to the
bind variables (if required), save values and so on.
Whilst it may seem better to have the Query object as a member of this class
this would then prevent the expression from being used separately from the Query
(a design goal of JoSQL, i.e. independent processing).
- Specified by:
getValue
in class Expression
- Parameters:
o
- The current object that the expression should be evaluated on.q
- The Query object.
- Returns:
- The value of the expression.
- Throws:
QueryExecutionException
- If something goes wrong with gaining the value.
evaluate
public abstract Object evaluate(Object o,
Query q)
throws QueryExecutionException
- Throws:
QueryExecutionException
Copyright © 2008 Gary Bentley. All Rights Reserved.