org.josql.expressions
Class ValueExpression

java.lang.Object
  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
ValueExpression()
           
 
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

ValueExpression

public ValueExpression()
Method Detail

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.