public void visit(CaseExpression caseExpression) throws Exception { if (caseExpression.getSwitchExpression() != null) { caseExpression.getSwitchExpression().accept(this); } if (caseExpression.getWhenClauses() != null) { for (Expression exp : caseExpression.getWhenClauses()) { exp.accept(this); } } if (caseExpression.getElseExpression() != null) { caseExpression.getElseExpression().accept(this); } }
/** @brief The following functions override functions of the interfaces. */ public void visit(PlainSelect plainSelect) throws Exception { if (plainSelect.getFromItem() != null) { if (plainSelect.getFromItem().getAlias() != null) { this.aliasTableNameList.add(plainSelect.getFromItem().getAlias().getName()); } plainSelect.getFromItem().accept(this); } if (plainSelect.getJoins() != null) { for (Iterator joinsIt = plainSelect.getJoins().iterator(); joinsIt.hasNext(); ) { Join join = (Join) joinsIt.next(); if (join.getRightItem().getAlias() != null) { this.aliasTableNameList.add(join.getRightItem().getAlias().getName()); } if (join.getOnExpression() != null) { join.getOnExpression().accept(this); } join.getRightItem().accept(this); } } // Select selectItem From fromItem, joinItem Where whereClause. if (plainSelect.getSelectItems() != null) { for (SelectItem selectItem : plainSelect.getSelectItems()) { selectItem.accept(this); } } if (plainSelect.getWhere() != null) { plainSelect.getWhere().accept(this); } if (plainSelect.getGroupByColumnReferences() != null) { for (Iterator groupByIt = plainSelect.getGroupByColumnReferences().iterator(); groupByIt.hasNext(); ) { Expression groupBy = (Expression) groupByIt.next(); groupBy.accept(this); } } if (plainSelect.getClusterByElements() != null) { for (Iterator clusterByit = plainSelect.getClusterByElements().iterator(); clusterByit.hasNext(); ) { ClusterByElement clusterByElement = (ClusterByElement) clusterByit.next(); visit(clusterByElement); } } if (plainSelect.getDistributeByElements() != null) { for (Iterator distributeByIt = plainSelect.getDistributeByElements().iterator(); distributeByIt.hasNext(); ) { DistributeByElement distributeByElement = (DistributeByElement) distributeByIt.next(); visit(distributeByElement); } } if (plainSelect.getOrderByElements() != null) { for (Iterator orderByIt = plainSelect.getOrderByElements().iterator(); orderByIt.hasNext(); ) { OrderByElement orderByElement = (OrderByElement) orderByIt.next(); orderByElement.accept(this); } } if (plainSelect.getSortByElements() != null) { for (Iterator sortByIt = plainSelect.getSortByElements().iterator(); sortByIt.hasNext(); ) { SortByElement sortByElement = (SortByElement) sortByIt.next(); visit(sortByElement); } } if (plainSelect.getHaving() != null) { plainSelect.getHaving().accept(this); } }
public void visit(ExpressionList expressionList) throws Exception { for (Iterator iter = expressionList.getExpressions().iterator(); iter.hasNext(); ) { Expression expression = (Expression) iter.next(); expression.accept(this); } }
public void visit(Function function) throws Exception { if (function.getParameters() == null) return; for (Expression exp : function.getParameters().getExpressions()) { exp.accept(this); } }