1 package org.apache.ojb.jdo.jdoql; 2 3 17 18 import java.util.Iterator ; 19 import java.util.List ; 20 21 26 public class VisitorBase implements Visitor 27 { 28 31 public void visitFilter(Expression filterExpr) 32 { 33 filterExpr.accept(this); 34 } 35 36 39 public void visitOrderings(List orderings) 40 { 41 for (Iterator it = orderings.iterator(); it.hasNext();) 42 { 43 ((Acceptor)it.next()).accept(this); 44 } 45 } 46 47 50 public void visitParameters(List params) 51 { 52 for (Iterator it = params.iterator(); it.hasNext();) 53 { 54 ((Acceptor)it.next()).accept(this); 55 } 56 } 57 58 61 public void visitVariables(List variables) 62 { 63 for (Iterator it = variables.iterator(); it.hasNext();) 64 { 65 ((Acceptor)it.next()).accept(this); 66 } 67 } 68 69 72 public void visit(BinaryExpression binExpr) 73 { 74 binExpr.getLeftSide().accept(this); 75 binExpr.getRightSide().accept(this); 76 } 77 78 81 public void visit(FieldAccess fieldAccess) 82 { 83 if (fieldAccess.hasBaseExpression()) 84 { 85 fieldAccess.getBaseExpression().accept(this); 86 } 87 } 88 89 92 public void visit(Import importSpec) 93 { 94 } 95 96 99 public void visit(Literal literal) 100 { 101 } 102 103 106 public void visit(LocalVariable localVar) 107 { 108 localVar.getType().accept(this); 109 } 110 111 114 public void visit(LocalVariableAccess localVarAccess) 115 { 116 } 117 118 121 public void visit(MethodInvocation methodInvoc) 122 { 123 if (methodInvoc.hasBaseExpression()) 124 { 125 methodInvoc.getBaseExpression().accept(this); 126 } 127 for (Iterator it = methodInvoc.getArguments().iterator(); it.hasNext();) 128 { 129 ((Acceptor)it.next()).accept(this); 130 } 131 } 132 133 136 public void visit(NullLiteral nullLit) 137 { 138 } 139 140 143 public void visit(Ordering ordering) 144 { 145 ordering.getExpression().accept(this); 146 } 147 148 151 public void visit(ThisExpression thisExpr) 152 { 153 } 154 155 158 public void visit(Type type) 159 { 160 } 161 162 165 public void visit(TypeAccess typeAccess) 166 { 167 if (typeAccess.hasBaseExpression()) 168 { 169 typeAccess.getBaseExpression().accept(this); 170 } 171 } 172 173 176 public void visit(UnaryExpression unaryExpr) 177 { 178 if (unaryExpr.getOperator() == UnaryExpression.OPERATOR_CAST) 179 { 180 unaryExpr.getCastType().accept(this); 181 } 182 unaryExpr.getInnerExpression().accept(this); 183 } 184 185 188 public void visit(NameExpression nameExpr) 189 { 190 if (nameExpr.hasBaseExpression()) 191 { 192 nameExpr.getBaseExpression().accept(this); 193 } 194 } 195 196 } 197 | Popular Tags |