01: /*
02: $Header: /cvsroot/xorm/xorm/src/org/xorm/query/ExpressionVisitor.java,v 1.5 2003/04/10 03:13:33 wbiggs Exp $
03:
04: This file is part of XORM.
05:
06: XORM is free software; you can redistribute it and/or modify
07: it under the terms of the GNU General Public License as published by
08: the Free Software Foundation; either version 2 of the License, or
09: (at your option) any later version.
10:
11: XORM is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with XORM; if not, write to the Free Software
18: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20: package org.xorm.query;
21:
22: public interface ExpressionVisitor {
23: boolean visitComparison(Expression.Comparison exp);
24:
25: boolean visitConstant(Expression.Constant exp);
26:
27: boolean visitMethodCall(Expression.MethodCall exp);
28:
29: boolean visitFieldAccess(Expression.FieldAccess exp);
30:
31: boolean visitParameter(Expression.Parameter exp);
32:
33: boolean visitVariable(Expression.Variable exp);
34:
35: boolean visitConditionalOr(Expression.ConditionalOr exp);
36:
37: boolean visitConditionalAnd(Expression.ConditionalAnd exp);
38:
39: boolean visitAnd(Expression.And exp);
40:
41: boolean visitUnary(Expression.Unary exp);
42:
43: boolean visitNot(Expression.Not exp);
44:
45: // etc. TODO
46:
47: public static class NoOp implements ExpressionVisitor {
48: public boolean visitComparison(Expression.Comparison exp) {
49: return false;
50: }
51:
52: public boolean visitConstant(Expression.Constant exp) {
53: return false;
54: }
55:
56: public boolean visitMethodCall(Expression.MethodCall exp) {
57: return false;
58: }
59:
60: public boolean visitFieldAccess(Expression.FieldAccess exp) {
61: return false;
62: }
63:
64: public boolean visitParameter(Expression.Parameter exp) {
65: return false;
66: }
67:
68: public boolean visitVariable(Expression.Variable exp) {
69: return false;
70: }
71:
72: public boolean visitConditionalOr(Expression.ConditionalOr exp) {
73: return false;
74: }
75:
76: public boolean visitConditionalAnd(Expression.ConditionalAnd exp) {
77: return false;
78: }
79:
80: public boolean visitAnd(Expression.And exp) {
81: return false;
82: }
83:
84: public boolean visitUnary(Expression.Unary exp) {
85: return false;
86: }
87:
88: public boolean visitNot(Expression.Not exp) {
89: return false;
90: }
91: }
92: }
|