/** * Traverses the children of the given appendable and manipulates it in-place. * @param parent the appendable whose children should be visited. */ protected void visitChildren(TreeAppendable parent) { for (int i = 0; i < parent.children.size(); i++) { Object o = parent.children.get(i); if (o instanceof String) { parent.children.set(i, visit((String) o)); } else { parent.children.set(i, visit((TreeAppendable) o)); } } }
public TreeAppendable acceptVisitor(TreeAppendable.Visitor visitor) { return visitor.visit(this); }