@Test public void testRecursionDetection() { ElementSymbol e1 = new ElementSymbol("g1.e1"); AggregateSymbol a1 = new AggregateSymbol(NonReserved.SUM, false, e1); Function f = new Function(SourceSystemFunctions.ADD_OP, new Expression[] {a1, a1}); HashMap<AggregateSymbol, AggregateSymbol> map = new HashMap<AggregateSymbol, AggregateSymbol>(); map.put(a1, new AggregateSymbol(NonReserved.SUM, false, a1)); ExpressionMappingVisitor.mapExpressions(f, map); assertEquals("(SUM(SUM(g1.e1)) + SUM(SUM(g1.e1)))", f.toString()); }
public static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap) { mapExpressions(obj, exprMap, false); }
ExpressionMappingVisitor extends LanguageVisitor { public static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap) { mapExpressions(obj, exprMap, false); } }
ExpressionMappingVisitor extends LanguageVisitor { public static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap) { mapExpressions(obj, exprMap, false); } ExpressionMappingVisitor(Map symbolMap);  ExpressionMappingVisitor(Map symbolMap, boolean clone); }
ExpressionMappingVisitor extends LanguageVisitor { public static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap) { mapExpressions(obj, exprMap, false); } ExpressionMappingVisitor(Map symbolMap);  ExpressionMappingVisitor(Map symbolMap, boolean clone); void visit(Select obj); boolean isClone(); void setClone(boolean clone); @Override void visit(DerivedColumn obj); @Override void visit(XMLTable obj); @Override void visit(JsonTable obj); @Override void visit(ObjectTable obj); @Override void visit(XMLSerialize obj); @Override void visit(XMLParse obj); void visit(AliasSymbol obj); void visit(ExpressionSymbol expr); void visit(BetweenCriteria obj); void visit(CaseExpression obj); void visit(CompareCriteria obj); void visit(Function obj); void visit(IsNullCriteria obj); void visit(MatchCriteria obj); void visit(SearchedCaseExpression obj); void visit(SetCriteria obj); void visit(DependentSetCriteria obj); void visit(SubqueryCompareCriteria obj); void visit(SubquerySetCriteria obj); Expression replaceExpression(Expression element); void visit(StoredProcedure obj); void visit(AggregateSymbol obj); void visit(GroupBy obj); @Override void visit(OrderByItem obj); void visit(Limit obj); void visit(DynamicCommand obj); void visit(SetClause obj); @Override void visit(QueryString obj); @Override void visit(ExpressionCriteria obj); static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap); static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap, boolean deep); void visit(AssignmentStatement obj); void visit(Insert obj); @Override void visit(XMLElement obj); @Override void visit(WindowSpecification windowSpecification); @Override void visit(Array array); @Override void visit(ExceptionExpression exceptionExpression); @Override void visit(ReturnStatement obj); @Override void visit(IsDistinctCriteria isDistinctCriteria); }
ExpressionMappingVisitor extends LanguageVisitor { public static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap) { mapExpressions(obj, exprMap, false); } ExpressionMappingVisitor(Map symbolMap);  ExpressionMappingVisitor(Map symbolMap, boolean clone); void visit(Select obj); boolean isClone(); void setClone(boolean clone); @Override void visit(DerivedColumn obj); @Override void visit(XMLTable obj); @Override void visit(JsonTable obj); @Override void visit(ObjectTable obj); @Override void visit(XMLSerialize obj); @Override void visit(XMLParse obj); void visit(AliasSymbol obj); void visit(ExpressionSymbol expr); void visit(BetweenCriteria obj); void visit(CaseExpression obj); void visit(CompareCriteria obj); void visit(Function obj); void visit(IsNullCriteria obj); void visit(MatchCriteria obj); void visit(SearchedCaseExpression obj); void visit(SetCriteria obj); void visit(DependentSetCriteria obj); void visit(SubqueryCompareCriteria obj); void visit(SubquerySetCriteria obj); Expression replaceExpression(Expression element); void visit(StoredProcedure obj); void visit(AggregateSymbol obj); void visit(GroupBy obj); @Override void visit(OrderByItem obj); void visit(Limit obj); void visit(DynamicCommand obj); void visit(SetClause obj); @Override void visit(QueryString obj); @Override void visit(ExpressionCriteria obj); static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap); static void mapExpressions(LanguageObject obj, Map<? extends Expression, ? extends Expression> exprMap, boolean deep); void visit(AssignmentStatement obj); void visit(Insert obj); @Override void visit(XMLElement obj); @Override void visit(WindowSpecification windowSpecification); @Override void visit(Array array); @Override void visit(ExceptionExpression exceptionExpression); @Override void visit(ReturnStatement obj); @Override void visit(IsDistinctCriteria isDistinctCriteria);  }