001: /*
002: * Copyright Aduna (http://www.aduna-software.com/) (c) 2008.
003: *
004: * Licensed under the Aduna BSD-style license.
005: */
006: package org.openrdf.sail.rdbms.algebra.base;
007:
008: import org.openrdf.query.algebra.helpers.QueryModelVisitorBase;
009: import org.openrdf.sail.rdbms.algebra.BNodeColumn;
010: import org.openrdf.sail.rdbms.algebra.DatatypeColumn;
011: import org.openrdf.sail.rdbms.algebra.DateTimeColumn;
012: import org.openrdf.sail.rdbms.algebra.DoubleValue;
013: import org.openrdf.sail.rdbms.algebra.FalseValue;
014: import org.openrdf.sail.rdbms.algebra.HashColumn;
015: import org.openrdf.sail.rdbms.algebra.IdColumn;
016: import org.openrdf.sail.rdbms.algebra.JoinItem;
017: import org.openrdf.sail.rdbms.algebra.LabelColumn;
018: import org.openrdf.sail.rdbms.algebra.LanguageColumn;
019: import org.openrdf.sail.rdbms.algebra.LongLabelColumn;
020: import org.openrdf.sail.rdbms.algebra.LongURIColumn;
021: import org.openrdf.sail.rdbms.algebra.NumberValue;
022: import org.openrdf.sail.rdbms.algebra.NumericColumn;
023: import org.openrdf.sail.rdbms.algebra.RefIdColumn;
024: import org.openrdf.sail.rdbms.algebra.SelectProjection;
025: import org.openrdf.sail.rdbms.algebra.SelectQuery;
026: import org.openrdf.sail.rdbms.algebra.SqlAbs;
027: import org.openrdf.sail.rdbms.algebra.SqlAnd;
028: import org.openrdf.sail.rdbms.algebra.SqlCase;
029: import org.openrdf.sail.rdbms.algebra.SqlCompare;
030: import org.openrdf.sail.rdbms.algebra.SqlConcat;
031: import org.openrdf.sail.rdbms.algebra.SqlEq;
032: import org.openrdf.sail.rdbms.algebra.SqlIsNull;
033: import org.openrdf.sail.rdbms.algebra.SqlLike;
034: import org.openrdf.sail.rdbms.algebra.SqlLowerCase;
035: import org.openrdf.sail.rdbms.algebra.SqlMathExpr;
036: import org.openrdf.sail.rdbms.algebra.SqlNot;
037: import org.openrdf.sail.rdbms.algebra.SqlNull;
038: import org.openrdf.sail.rdbms.algebra.SqlOr;
039: import org.openrdf.sail.rdbms.algebra.SqlRegex;
040: import org.openrdf.sail.rdbms.algebra.SqlShift;
041: import org.openrdf.sail.rdbms.algebra.StringValue;
042: import org.openrdf.sail.rdbms.algebra.TrueValue;
043: import org.openrdf.sail.rdbms.algebra.URIColumn;
044: import org.openrdf.sail.rdbms.algebra.UnionItem;
045:
046: /**
047: * Base class for RDBMS visitor classes. This class is extended with additional
048: * meet methods.
049: *
050: * @author James Leigh
051: *
052: */
053: public class RdbmsQueryModelVisitorBase<X extends Exception> extends
054: QueryModelVisitorBase<X> {
055: public void meet(BNodeColumn node) throws X {
056: meetValueColumnBase(node);
057: }
058:
059: public void meet(DatatypeColumn node) throws X {
060: meetValueColumnBase(node);
061: }
062:
063: public void meet(DateTimeColumn node) throws X {
064: meetValueColumnBase(node);
065: }
066:
067: public void meet(DoubleValue node) throws X {
068: meetSqlConstant(node);
069: }
070:
071: public void meet(FalseValue node) throws X {
072: meetSqlConstant(node);
073: }
074:
075: public void meet(HashColumn node) throws X {
076: meetValueColumnBase(node);
077: }
078:
079: public void meet(IdColumn node) throws X {
080: meetSqlExpr(node);
081: }
082:
083: public void meet(JoinItem node) throws X {
084: meetFromItem(node);
085: }
086:
087: public void meet(LabelColumn node) throws X {
088: meetValueColumnBase(node);
089: }
090:
091: public void meet(LanguageColumn node) throws X {
092: meetValueColumnBase(node);
093: }
094:
095: public void meet(LongLabelColumn node) throws X {
096: meetValueColumnBase(node);
097: }
098:
099: public void meet(LongURIColumn node) throws X {
100: meetValueColumnBase(node);
101: }
102:
103: public void meet(NumberValue node) throws X {
104: meetSqlConstant(node);
105: }
106:
107: public void meet(NumericColumn node) throws X {
108: meetValueColumnBase(node);
109: }
110:
111: public void meet(RefIdColumn node) throws X {
112: meetValueColumnBase(node);
113: }
114:
115: public void meet(SelectProjection node) throws X {
116: meetNode(node);
117: }
118:
119: public void meet(SelectQuery node) throws X {
120: meetNode(node);
121: }
122:
123: public void meet(SqlAbs node) throws X {
124: meetUnarySqlOperator(node);
125: }
126:
127: public void meet(SqlAnd node) throws X {
128: meetBinarySqlOperator(node);
129: }
130:
131: public void meet(SqlCase node) throws X {
132: meetNode(node);
133: }
134:
135: public void meet(SqlCompare node) throws X {
136: meetBinarySqlOperator(node);
137: }
138:
139: public void meet(SqlConcat node) throws X {
140: meetBinarySqlOperator(node);
141: }
142:
143: public void meet(SqlEq node) throws X {
144: meetBinarySqlOperator(node);
145: }
146:
147: public void meet(SqlIsNull node) throws X {
148: meetUnarySqlOperator(node);
149: }
150:
151: public void meet(SqlLike node) throws X {
152: meetBinarySqlOperator(node);
153: }
154:
155: public void meet(SqlLowerCase node) throws X {
156: meetUnarySqlOperator(node);
157: }
158:
159: public void meet(SqlMathExpr node) throws X {
160: meetBinarySqlOperator(node);
161: }
162:
163: public void meet(SqlNot node) throws X {
164: meetUnarySqlOperator(node);
165: }
166:
167: public void meet(SqlNull node) throws X {
168: meetSqlConstant(node);
169: }
170:
171: public void meet(SqlOr node) throws X {
172: meetBinarySqlOperator(node);
173: }
174:
175: public void meet(SqlRegex node) throws X {
176: meetBinarySqlOperator(node);
177: }
178:
179: public void meet(SqlShift node) throws X {
180: meetUnarySqlOperator(node);
181: }
182:
183: public void meet(StringValue node) throws X {
184: meetSqlConstant(node);
185: }
186:
187: public void meet(TrueValue node) throws X {
188: meetSqlConstant(node);
189: }
190:
191: public void meet(UnionItem node) throws X {
192: meetFromItem(node);
193: }
194:
195: public void meet(URIColumn node) throws X {
196: meetValueColumnBase(node);
197: }
198:
199: protected void meetBinarySqlOperator(BinarySqlOperator node)
200: throws X {
201: meetNode(node);
202: }
203:
204: protected void meetFromItem(FromItem node) throws X {
205: meetNode(node);
206: }
207:
208: protected void meetSqlConstant(SqlConstant<?> node) throws X {
209: meetNode(node);
210: }
211:
212: protected void meetSqlExpr(SqlExpr node) throws X {
213: meetNode(node);
214: }
215:
216: protected void meetUnarySqlOperator(UnarySqlOperator node) throws X {
217: meetNode(node);
218: }
219:
220: protected void meetValueColumnBase(ValueColumnBase node) throws X {
221: meetSqlExpr(node);
222: }
223: }
|