org.xorm.query
Class ExpressionValidator

java.lang.Object
  |
  +--org.xorm.query.ExpressionVisitor.NoOp
        |
        +--org.xorm.query.ExpressionValidator
All Implemented Interfaces:
ExpressionVisitor

public class ExpressionValidator
extends ExpressionVisitor.NoOp

Validates and normalizes expressions.


Nested Class Summary
 
Nested classes inherited from class org.xorm.query.ExpressionVisitor
ExpressionVisitor.NoOp
 
Constructor Summary
ExpressionValidator(QueryImpl query)
           
 
Method Summary
 boolean isValid()
           
 boolean visitComparison(Expression.Comparison exp)
          Ensures that both sides of a comparison are valid.
 boolean visitFieldAccess(Expression.FieldAccess exp)
          Ensures that the field is mapped for the owning class and sets the Type field to the correct class.
 boolean visitMethodCall(Expression.MethodCall exp)
          Ensures that the method is acceptable as per the JDO spec.
 boolean visitNot(Expression.Not exp)
           
 boolean visitParameter(Expression.Parameter exp)
          Ensures that the named parameter has been declared.
 boolean visitUnary(Expression.Unary exp)
           
 boolean visitVariable(Expression.Variable exp)
          Ensures that the named variable has been declared.
 
Methods inherited from class org.xorm.query.ExpressionVisitor.NoOp
visitAnd, visitConditionalAnd, visitConditionalOr, visitConstant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionValidator

public ExpressionValidator(QueryImpl query)
Method Detail

isValid

public boolean isValid()

visitComparison

public boolean visitComparison(Expression.Comparison exp)
Ensures that both sides of a comparison are valid.

Specified by:
visitComparison in interface ExpressionVisitor
Overrides:
visitComparison in class ExpressionVisitor.NoOp

visitMethodCall

public boolean visitMethodCall(Expression.MethodCall exp)
Ensures that the method is acceptable as per the JDO spec.

Specified by:
visitMethodCall in interface ExpressionVisitor
Overrides:
visitMethodCall in class ExpressionVisitor.NoOp

visitFieldAccess

public boolean visitFieldAccess(Expression.FieldAccess exp)
Ensures that the field is mapped for the owning class and sets the Type field to the correct class.

Specified by:
visitFieldAccess in interface ExpressionVisitor
Overrides:
visitFieldAccess in class ExpressionVisitor.NoOp

visitParameter

public boolean visitParameter(Expression.Parameter exp)
Ensures that the named parameter has been declared.

Specified by:
visitParameter in interface ExpressionVisitor
Overrides:
visitParameter in class ExpressionVisitor.NoOp

visitVariable

public boolean visitVariable(Expression.Variable exp)
Ensures that the named variable has been declared.

Specified by:
visitVariable in interface ExpressionVisitor
Overrides:
visitVariable in class ExpressionVisitor.NoOp

visitNot

public boolean visitNot(Expression.Not exp)
Specified by:
visitNot in interface ExpressionVisitor
Overrides:
visitNot in class ExpressionVisitor.NoOp

visitUnary

public boolean visitUnary(Expression.Unary exp)
Specified by:
visitUnary in interface ExpressionVisitor
Overrides:
visitUnary in class ExpressionVisitor.NoOp


$Header: /cvsroot/xorm/xorm/docs/api/org/xorm/query/ExpressionValidator.html,v 1.2 2004/05/30 08:55:08 wbiggs Exp $