Class ValueExpression

  extended by org.josql.expressions.Expression
      extended by org.josql.expressions.ValueExpression
Direct Known Subclasses:
Accessor, ArithmeticExpression, BindVariable, BooleanExpression, ConstantExpression, ExpressionList, Function, NewObjectExpression, SaveValue, SubQueryExpression

public abstract class ValueExpression
extends Expression

Constructor Summary
Method Summary
abstract  Object evaluate(Object o, Query q)
 Object getValue(Object o, Query q)
          Get the value for this expression based upon the object passed in.
Methods inherited from class org.josql.expressions.Expression
getExpectedReturnType, hasFixedResult, init, isBracketed, isTrue, setBracketed, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public ValueExpression()
Method Detail


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
o - The current object that the expression should be evaluated on.
q - The Query object.
The value of the expression.
QueryExecutionException - If something goes wrong with gaining the value.


public abstract Object evaluate(Object o,
                                Query q)
                         throws QueryExecutionException

  Copyright © 2008 Gary Bentley. All Rights Reserved.