public void node(final DiffNode node, final Visit visit) { if (maxDepth == 0) { visit.stop(); } final int currentLevel = calculateDepth(node); if (maxDepth > 0) { if (currentLevel <= maxDepth) { print(node, currentLevel); } else { visit.dontGoDeeper(); } } else if (maxDepth < 0) { print(node, currentLevel); } }
protected final void visit(final Visitor visitor, final Visit visit) { try { visitor.node(this, visit); } catch (final StopVisitationException e) { visit.stop(); } if (visit.isAllowedToGoDeeper() && hasChildren()) { visitChildren(visitor); } if (visit.isStopped()) { throw new StopVisitationException(); } }
@Override protected void onAccept(final DiffNode node, final Visit visit) { super.onAccept(node, visit); visit.dontGoDeeper(); }
public void node(final DiffNode node, final Visit visit) { if (node.hasChanges()) { result.set(true); visit.stop(); } } });
/** * Visit this and all child nodes. * * @param visitor The visitor to use. */ public final void visit(final Visitor visitor) { final Visit visit = new Visit(); try { visit(visitor, visit); } catch (final StopVisitationException ignored) { } }
@Override protected void onDismiss(final DiffNode node, final Visit visit) { super.onDismiss(node, visit); visit.dontGoDeeper(); } }
public void node(final DiffNode node, final Visit visit) { if (node.hasChanges()) { result.set(true); visit.stop(); } } });
/** * Visit this and all child nodes. * * @param visitor The visitor to use. */ public final void visit(final Visitor visitor) { final Visit visit = new Visit(); try { visit(visitor, visit); } catch (final StopVisitationException ignored) { } }
protected final void visit(final Visitor visitor, final Visit visit) { try { visitor.node(this, visit); } catch (final StopVisitationException e) { visit.stop(); } if (visit.isAllowedToGoDeeper() && hasChildren()) { visitChildren(visitor); } if (visit.isStopped()) { throw new StopVisitationException(); } }
public void node(final DiffNode node, final Visit visit) { final NodePath differencePath = node.getPath(); if (differencePath.matches(nodePath) || differencePath.isParentOf(nodePath)) { if (differencePath.matches(nodePath)) { this.node = node; visit.stop(); } } else { visit.dontGoDeeper(); } }
@Override protected void onDismiss(final DiffNode node, final Visit visit) { super.onDismiss(node, visit); visit.dontGoDeeper(); }
public void node(final DiffNode node, final Visit visit) { if (maxDepth == 0) { visit.stop(); } final int currentLevel = calculateDepth(node); if (maxDepth > 0) { if (currentLevel <= maxDepth) { print(node, currentLevel); } else { visit.dontGoDeeper(); } } else if (maxDepth < 0) { print(node, currentLevel); } }
public void node(final DiffNode node, final Visit visit) { if (node.getState() == DiffNode.State.ADDED) { node.canonicalSet(head, node.canonicalGet(modified)); } else if (node.getState() == DiffNode.State.REMOVED) { node.canonicalUnset(head); } else if (node.getState() == DiffNode.State.CHANGED) { if (node.hasChildren()) { node.visitChildren(this); visit.dontGoDeeper(); } else { node.canonicalSet(head, node.canonicalGet(modified)); } } } }
public void node(final DiffNode node, final Visit visit) { final NodePath differencePath = node.getPath(); if (differencePath.matches(nodePath) || differencePath.isParentOf(nodePath)) { if (differencePath.matches(nodePath)) { this.node = node; visit.stop(); } } else { visit.dontGoDeeper(); } }
@Override protected void onDismiss(final DiffNode node, final Visit visit) { super.onDismiss(node, visit); visit.dontGoDeeper(); }
@Override protected void onAccept(final DiffNode node, final Visit visit) { super.onAccept(node, visit); visit.dontGoDeeper(); }
@Override protected void onDismiss(final DiffNode node, final Visit visit) { super.onDismiss(node, visit); visit.dontGoDeeper(); } }
public void node(final DiffNode node, final Visit visit) { if (node.getState() == DiffNode.State.ADDED) { node.canonicalSet(head, node.canonicalGet(modified)); } else if (node.getState() == DiffNode.State.REMOVED) { node.canonicalUnset(head); } else if (node.getState() == DiffNode.State.CHANGED) { if (node.hasChildren()) { node.visitChildren(this); visit.dontGoDeeper(); } else { node.canonicalSet(head, node.canonicalGet(modified)); } } } }