/** * Returns the children of this GPathResult as a GPathResult object. * * @return the children of this GPathResult */ public GPathResult children() { return new NodeChildren(this, this.namespaceTagHints); }
public synchronized int size() { if (this.size == -1) { final Iterator iter = iterator(); this.size = 0; while (iter.hasNext()) { iter.next(); this.size++; } } return this.size; }
public Iterator iterator() { return new Iterator() { final Iterator iter = nodeIterator(); public boolean hasNext() { return iter.hasNext(); } public Object next() { return new NodeChild((Node) iter.next(), pop(), namespaceTagHints); } public void remove() { throw new UnsupportedOperationException(); } }; }
public GPathResult parents() { return super.parents(); }
public Object next() { return new NodeChild((Node) iter.next(), pop(), namespaceTagHints); }
public GPathResult parents() { return super.parents(); }
public Object next() { return new NodeChild((Node) iter.next(), pop(), namespaceTagHints); }
protected void replaceNode(final Closure newValue) { final Iterator iter = iterator(); while (iter.hasNext()) { final NodeChild result = (NodeChild) iter.next(); result.replaceNode(newValue); } }
public String text() { final StringBuilder buf = new StringBuilder(); final Iterator iter = nodeIterator(); while (iter.hasNext()) { buf.append(((Node) iter.next()).text()); } return buf.toString(); }
if (property.contains(":") && !this.namespaceTagHints.isEmpty()) { final int i = property.indexOf(":"); return new NodeChildren(this, property.substring(i + 1), property.substring(0, i), this.namespaceTagHints); } else { return new NodeChildren(this, property, this.namespaceTagHints);
public GPathResult parents() { return super.parents(); }
protected void appendNode(final Object newValue) { final Iterator iter = iterator(); while (iter.hasNext()) { final NodeChild result = (NodeChild) iter.next(); result.appendNode(newValue); } } }
public Writer writeTo(final Writer out) throws IOException { final Iterator iter = nodeIterator(); while (iter.hasNext()) { ((Node) iter.next()).writeTo(out); } return out; }
final GPathResult result = new NodeChildren(this, property, this.namespaceTagHints);
public GPathResult parents() { return super.parents(); }
protected void replaceBody(final Object newValue) { final Iterator iter = iterator(); while (iter.hasNext()) { final NodeChild result = (NodeChild) iter.next(); result.replaceBody(newValue); } }
public void build(final GroovyObject builder) { final Iterator iter = nodeIterator(); while (iter.hasNext()) { final Object next = iter.next(); if (next instanceof Buildable) { ((Buildable) next).build(builder); } else { ((Node) next).build(builder, namespaceMap, namespaceTagHints); } } }
/** * Returns the children of this GPathResult as a GPathResult object. * * @return the children of this GPathResult */ public GPathResult children() { return new NodeChildren(this, this.namespaceTagHints); }
public GPathResult parents() { return super.parents(); }
public GPathResult find(final Closure closure) { final Iterator iter = iterator(); while (iter.hasNext()) { final Object node = iter.next(); if (DefaultTypeTransformation.castToBoolean(closure.call(new Object[]{node}))) { return (GPathResult) node; } } return new NoChildren(this, this.name, namespaceTagHints); }