001: /*
002: * Copyright (c) 1998 - 2005 Versant Corporation
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * Versant Corporation - initial API and implementation
010: */
011: package com.versant.core.jdo.query;
012:
013: /**
014: * Base class for classes implementing NodeVisitor with do nothing
015: * implementations of all the methods. This makes it possible to add new
016: * methods to the interface without breaking existing code.
017: */
018: public class NodeVisitorAdapter implements NodeVisitor {
019:
020: /**
021: * Default visit implementation. Returns null.
022: */
023: protected Object defaultVisit(Node node, Object[] results) {
024: return null;
025: }
026:
027: /**
028: * Default arrive implementation. Returns null.
029: */
030: protected Object defaultArrive(Node node, Object msg) {
031: return null;
032: }
033:
034: public Object visitLiteralNode(LiteralNode node, Object[] results) {
035: return defaultVisit(node, results);
036: }
037:
038: public Object visitAddNode(AddNode node, Object[] results) {
039: return defaultVisit(node, results);
040: }
041:
042: public Object visitMultiplyNode(MultiplyNode node, Object[] results) {
043: return defaultVisit(node, results);
044: }
045:
046: public Object visitUnaryNode(UnaryNode node, Object[] results) {
047: return defaultVisit(node, results);
048: }
049:
050: public Object visitUnaryOpNode(UnaryOpNode node, Object[] results) {
051: return defaultVisit(node, results);
052: }
053:
054: public Object visitNotEqualNode(NotEqualNode node, Object[] results) {
055: return defaultVisit(node, results);
056: }
057:
058: public Object visitEqualNode(EqualNode node, Object[] results) {
059: return defaultVisit(node, results);
060: }
061:
062: public Object visitLikeNode(LikeNode node, Object[] results) {
063: return defaultVisit(node, results);
064: }
065:
066: public Object visitCompareOpNode(CompareOpNode node,
067: Object[] results) {
068: return defaultVisit(node, results);
069: }
070:
071: public Object visitParamNode(ParamNode node, Object[] results) {
072: return defaultVisit(node, results);
073: }
074:
075: public Object visitFieldNode(FieldNode node, Object[] results) {
076: return defaultVisit(node, results);
077: }
078:
079: public Object visitFieldNavNode(FieldNavNode node, Object[] results) {
080: return defaultVisit(node, results);
081: }
082:
083: public Object visitVarNode(VarNode node, Object[] results) {
084: return defaultVisit(node, results);
085: }
086:
087: public Object visitMethodNode(MethodNode node, Object[] results) {
088: return defaultVisit(node, results);
089: }
090:
091: public Object visitAndNode(AndNode node, Object[] results) {
092: return defaultVisit(node, results);
093: }
094:
095: public Object visitOrNode(OrNode node, Object[] results) {
096: return defaultVisit(node, results);
097: }
098:
099: public Object visitAggregateCountStarNode(
100: AggregateCountStarNode node, Object[] results) {
101: return defaultVisit(node, results);
102: }
103:
104: public Object visitAggregateNode(AggregateNode node,
105: Object[] results) {
106: return defaultVisit(node, results);
107: }
108:
109: public Object visitAsValueNode(AsValueNode node, Object[] results) {
110: return defaultVisit(node, results);
111: }
112:
113: public Object visitGroupingNode(GroupingNode node, Object[] results) {
114: return defaultVisit(node, results);
115: }
116:
117: public Object visitResultNode(ResultNode node, Object[] results) {
118: return defaultVisit(node, results);
119: }
120:
121: public Object visitVarBindingNode(VarBindingNode node,
122: Object[] results) {
123: return defaultVisit(node, results);
124: }
125:
126: public Object visitOrderNode(OrderNode node, Object[] results) {
127: return defaultVisit(node, results);
128: }
129:
130: public Object arriveLiteralNode(LiteralNode node, Object msg) {
131: return defaultArrive(node, msg);
132: }
133:
134: public Object arriveFieldNavNode(FieldNavNode node, Object msg) {
135: return defaultArrive(node, msg);
136: }
137:
138: public Object arriveMethodNode(MethodNode node, Object msg) {
139: return defaultArrive(node, msg);
140: }
141:
142: public Object arrivePrimaryExprNode(PrimaryExprNode node, Object msg) {
143: return defaultArrive(node, msg);
144: }
145:
146: public Object arriveFieldNode(FieldNode node, Object msg) {
147: return defaultArrive(node, msg);
148: }
149:
150: public Object arriveEqualNode(EqualNode node, Object msg) {
151: return defaultArrive(node, msg);
152: }
153:
154: public Object arriveLikeNode(LikeNode node, Object msg) {
155: return defaultArrive(node, msg);
156: }
157:
158: public Object arriveNotEqualNode(NotEqualNode node, Object msg) {
159: return defaultArrive(node, msg);
160: }
161:
162: public Object arriveAndNode(AndNode node, Object msg) {
163: return defaultArrive(node, msg);
164: }
165:
166: public Object arriveOrNode(OrNode node, Object msg) {
167: return defaultArrive(node, msg);
168: }
169:
170: public Object arriveMultiplyNode(MultiplyNode node, Object msg) {
171: return defaultArrive(node, msg);
172: }
173:
174: public Object arriveAddNode(AddNode node, Object msg) {
175: return defaultArrive(node, msg);
176: }
177:
178: public Object arriveUnaryOpNode(UnaryOpNode node, Object msg) {
179: return defaultArrive(node, msg);
180: }
181:
182: public Object arriveCompareOpNode(CompareOpNode node, Object msg) {
183: return defaultArrive(node, msg);
184: }
185:
186: public Object arriveUnaryNode(UnaryNode node, Object msg) {
187: return defaultArrive(node, msg);
188: }
189:
190: public Object arriveBinaryNode(BinaryNode node, Object msg) {
191: return defaultArrive(node, msg);
192: }
193:
194: public Object arriveCastNode(CastNode node, Object msg) {
195: return defaultArrive(node, msg);
196: }
197:
198: public Object arriveParamNode(ParamNode node, Object msg) {
199: return defaultArrive(node, msg);
200: }
201:
202: public Object arriveParamNodeProxy(ParamNodeProxy node, Object msg) {
203: return defaultArrive(node, msg);
204: }
205:
206: public Object arriveArgNode(ArgNode node, Object msg) {
207: return defaultArrive(node, msg);
208: }
209:
210: public Object arriveArrayNode(ArrayNode node, Object msg) {
211: return defaultArrive(node, msg);
212: }
213:
214: public Object arriveImportNode(ImportNode node, Object msg) {
215: return defaultArrive(node, msg);
216: }
217:
218: public Object arriveLeafNode(LeafNode node, Object msg) {
219: return defaultArrive(node, msg);
220: }
221:
222: public Object arriveOrderNode(OrderNode node, Object msg) {
223: return defaultArrive(node, msg);
224: }
225:
226: public Object arriveVarNode(VarNode node, Object msg) {
227: return defaultArrive(node, msg);
228: }
229:
230: public Object arriveVarNodeProxy(VarNodeProxy node, Object msg) {
231: return defaultArrive(node, msg);
232: }
233:
234: public Object arriveReservedFieldNode(ReservedFieldNode node,
235: Object msg) {
236: return defaultArrive(node, msg);
237: }
238:
239: public Object arriveAggregateCountStarNode(
240: AggregateCountStarNode node, Object msg) {
241: return defaultArrive(node, msg);
242: }
243:
244: public Object arriveAggregateNode(AggregateNode node, Object msg) {
245: return defaultArrive(node, msg);
246: }
247:
248: public Object arriveAsValueNode(AsValueNode node, Object msg) {
249: return defaultArrive(node, msg);
250: }
251:
252: public Object arriveGroupingNode(GroupingNode node, Object msg) {
253: return defaultArrive(node, msg);
254: }
255:
256: public Object arriveResultNode(ResultNode node, Object msg) {
257: return defaultArrive(node, msg);
258: }
259:
260: public Object arriveVarBindingNode(VarBindingNode node, Object msg) {
261: return defaultArrive(node, msg);
262: }
263:
264: }
|