/** * Returns an iterator over all child elements of this element. */ public Iterator<Element> getElementIterator() { return getElementIterator(null); }
/** * Returns an iterator over all child elements of this element. */ public Iterator<Element> getElementIterator() { return getElementIterator(null); }
/** * Returns an iterator over all child elements of this element. */ public Iterator<Element> getElementIterator() { return getElementIterator(null); }
public Iterator<Element> getElementIterator(Element element) { return element.getElementIterator(this); }
public Iterator<Element> getElementIterator(Element element) { return element.getElementIterator(this); }
public Iterator<Element> getElementIterator(Element element) { return element.getElementIterator(this); }
/** * Visit all of the children of this element, calling the element visitor * with the child element and child metadata for each child. */ private void visitChildren(ElementVisitor ev, ElementMetadata<?, ?> meta) throws ElementVisitor.StoppedException { // Visit children Iterator<Element> childIterator = getElementIterator(meta); while (childIterator.hasNext()) { Element child = childIterator.next(); ElementMetadata<?, ?> childMeta = (meta == null) ? null : meta.bindElement(child.getElementKey()); child.visit(ev, this, childMeta); } }
/** * Visit all of the children of this element, calling the element visitor * with the child element and child metadata for each child. */ private void visitChildren(ElementVisitor ev, ElementMetadata<?, ?> meta) throws ElementVisitor.StoppedException { // Visit children Iterator<Element> childIterator = getElementIterator(meta); while (childIterator.hasNext()) { Element child = childIterator.next(); ElementMetadata<?, ?> childMeta = (meta == null) ? null : meta.bindElement(child.getElementKey()); child.visit(ev, this, childMeta); } }
/** * Visit all of the children of this element, calling the element visitor * with the child element and child metadata for each child. */ private void visitChildren(ElementVisitor ev, ElementMetadata<?, ?> meta) throws ElementVisitor.StoppedException { // Visit children Iterator<Element> childIterator = getElementIterator(meta); while (childIterator.hasNext()) { Element child = childIterator.next(); ElementMetadata<?, ?> childMeta = (meta == null) ? null : meta.bindElement(child.getElementKey()); child.visit(ev, this, childMeta); } }
Iterator<Element> childIterator = narrowed.getElementIterator(); if (childIterator.hasNext()) { List<Pair<Element, Element>> replacements = Lists.newArrayList();
Iterator<Element> childIterator = narrowed.getElementIterator(); if (childIterator.hasNext()) { List<Pair<Element, Element>> replacements = Lists.newArrayList();
Iterator<Element> childIterator = narrowed.getElementIterator(); if (childIterator.hasNext()) { List<Pair<Element, Element>> replacements = Lists.newArrayList();
/** * Calculate the namespaces on an element using the given visitor to store * the namespaces. We cheat by using an attribute visitor for even visiting * the element names, because all we're doing with the visitor is adding a * QName. */ private static void calculateNamespaces(Map<String, XmlNamespace> namespaces, Element e, ElementMetadata<?, ?> metadata) { QName name = (metadata == null) ? e.getElementId() : metadata.getName(); addNamespace(namespaces, name); Iterator<Attribute> attIter = e.getAttributeIterator(metadata); while (attIter.hasNext()) { Attribute att = attIter.next(); AttributeKey<?> attKey = att.getAttributeKey(); AttributeMetadata<?> attMeta = (metadata == null) ? null : metadata.bindAttribute(attKey); name = (attMeta == null) ? attKey.getId() : attMeta.getName(); addNamespace(namespaces, name); } Iterator<Element> childIter = e.getElementIterator(metadata); while (childIter.hasNext()) { Element child = childIter.next(); ElementMetadata<?, ?> childMeta = (metadata == null) ? null : metadata.bindElement(child.getElementKey()); calculateNamespaces(namespaces, child, childMeta); } }
/** * Calculate the namespaces on an element using the given visitor to store * the namespaces. We cheat by using an attribute visitor for even visiting * the element names, because all we're doing with the visitor is adding a * QName. */ private static void calculateNamespaces(Map<String, XmlNamespace> namespaces, Element e, ElementMetadata<?, ?> metadata) { QName name = (metadata == null) ? e.getElementId() : metadata.getName(); addNamespace(namespaces, name); Iterator<Attribute> attIter = e.getAttributeIterator(metadata); while (attIter.hasNext()) { Attribute att = attIter.next(); AttributeKey<?> attKey = att.getAttributeKey(); AttributeMetadata<?> attMeta = (metadata == null) ? null : metadata.bindAttribute(attKey); name = (attMeta == null) ? attKey.getId() : attMeta.getName(); addNamespace(namespaces, name); } Iterator<Element> childIter = e.getElementIterator(metadata); while (childIter.hasNext()) { Element child = childIter.next(); ElementMetadata<?, ?> childMeta = (metadata == null) ? null : metadata.bindElement(child.getElementKey()); calculateNamespaces(namespaces, child, childMeta); } }
/** * Calculate the namespaces on an element using the given visitor to store * the namespaces. We cheat by using an attribute visitor for even visiting * the element names, because all we're doing with the visitor is adding a * QName. */ private static void calculateNamespaces(Map<String, XmlNamespace> namespaces, Element e, ElementMetadata<?, ?> metadata) { QName name = (metadata == null) ? e.getElementId() : metadata.getName(); addNamespace(namespaces, name); Iterator<Attribute> attIter = e.getAttributeIterator(metadata); while (attIter.hasNext()) { Attribute att = attIter.next(); AttributeKey<?> attKey = att.getAttributeKey(); AttributeMetadata<?> attMeta = (metadata == null) ? null : metadata.bindAttribute(attKey); name = (attMeta == null) ? attKey.getId() : attMeta.getName(); addNamespace(namespaces, name); } Iterator<Element> childIter = e.getElementIterator(metadata); while (childIter.hasNext()) { Element child = childIter.next(); ElementMetadata<?, ?> childMeta = (metadata == null) ? null : metadata.bindElement(child.getElementKey()); calculateNamespaces(namespaces, child, childMeta); } }