public Iterator<org.w3c.dom.Node> getChildElements() { log.trace("getChildElements"); expandToDOM(); return super.getChildElements(); }
public Iterator<SOAPElement> getChildElements(Name name) { if (log.isTraceEnabled()) log.trace("getChildElements: [name=" + name + "]"); expandToDOM(); return super.getChildElements(name); }
public Iterator<SOAPElement> getChildElements(QName qname) { List<SOAPElement> list = new ArrayList<SOAPElement>(); Iterator<org.w3c.dom.Node> it = getChildElements(); while (it.hasNext()) { Object elementOrTextNode = it.next(); if (elementOrTextNode instanceof SOAPElement) { SOAPElement el = (SOAPElement)elementOrTextNode; if (el.getElementQName().equals(qname)) list.add(el); } } return list.iterator(); }
/** * Detaches all children of this SOAPElement. * <p/> * This method is useful for rolling back the construction of partially completed SOAPHeaders and SOAPBodys in * preparation for sending a fault when an error condition is detected. * It is also useful for recycling portions of a document within a SOAP message. */ public void removeContents() { Iterator<org.w3c.dom.Node> it = getChildElements(); while (it.hasNext()) { Node el = (Node)it.next(); el.detachNode(); } }
/** * Returns an Iterator over all the immediate child Nodes of this element with the specified name. * <p/> * All of these children will be SOAPElement nodes. * Calling this method may cause child Element, SOAPElement and org.w3c.dom.Text nodes to be replaced by SOAPElement, * SOAPHeaderElement, SOAPBodyElement or javax.xml.soap.Text nodes as appropriate for the type of this parent node. * As a result the calling application must treat any existing references to these child nodes that have been obtained * through DOM APIs as invalid and either discard them or refresh them with the values returned by this Iterator. * This behavior can be avoided by calling the equivalent DOM APIs. See javax.xml.soap for more details. * * @param name a Name object with the name of the child elements to be returned * @return an Iterator object over all the elements in this SOAPElement object with the specified name */ public Iterator<SOAPElement> getChildElements(Name name) { QName qName = SOAPUtils.toQName(name); return getChildElements(qName); }
protected void writeElementContent(Writer out) throws IOException { Iterator<org.w3c.dom.Node> it = getChildElements(); if (it.hasNext()) { while (it.hasNext()) { Node node = (Node)it.next(); if (node instanceof SOAPElementImpl) { ((SOAPElementImpl)node).writeElement(out); } else if (node instanceof TextImpl) { ((TextImpl)node).writeNode(out); } else { throw new WSException(BundleUtils.getMessage(bundle, "UNHANDLED_SOAP_NODE", node.getClass().getName())); } } } else { String value = getValue(); if (value != null) out.write(value); } } }