1 21 22 23 package org.apache.derby.impl.sql.compile; 24 25 import org.apache.derby.iapi.sql.compile.Visitable; 26 import org.apache.derby.iapi.sql.compile.Visitor; 27 28 import org.apache.derby.iapi.error.StandardException; 29 30 36 public class RemapCRsVisitor implements Visitor 37 { 38 private boolean remap; 39 40 public RemapCRsVisitor(boolean remap) 41 { 42 this.remap = remap; 43 } 44 45 46 52 62 public Visitable visit(Visitable node) 63 throws StandardException 64 { 65 71 if (node instanceof ColumnReference) 72 { 73 ColumnReference cr = (ColumnReference) node; 74 if (remap) 75 { 76 cr.remapColumnReferences(); 77 } 78 else 79 { 80 cr.unRemapColumnReferences(); 81 } 82 } 83 84 return node; 85 } 86 87 92 public boolean skipChildren(Visitable node) 93 { 94 return (node instanceof SubqueryNode); 95 } 96 97 public boolean stopTraversal() 98 { 99 return false; 100 } 101 102 108 } 109 | Popular Tags |