private final void end(QueryPart part) { if (visitParts != null) { for (VisitListener listener : visitListeners) listener.visitEnd(visitContext); if (visitParts.removeLast() != part) throw new RuntimeException("Mismatch between visited query parts"); } }
private final QueryPart start(QueryPart part) { visitParts.addLast(part); for (VisitListener listener : visitListeners) { listener.visitStart(visitContext); } return visitParts.peekLast(); }
@Override public final C start(Clause clause) { if (clause != null && visitClauses != null) { visitClauses.addLast(clause); for (VisitListener listener : visitListeners) listener.clauseStart(visitContext); } return (C) this; }
private final QueryPart start(QueryPart part) { if (visitParts != null) { visitParts.addLast(part); for (VisitListener listener : visitListeners) listener.visitStart(visitContext); return visitParts.peekLast(); } else { return part; } }
@Override public final C end(Clause clause) { if (clause != null && visitClauses != null) { for (VisitListener listener : visitListeners) listener.clauseEnd(visitContext); if (visitClauses.removeLast() != clause) throw new IllegalStateException("Mismatch between visited clauses!"); } return (C) this; }