public Name getElementName() { return super.getElementName(); }
public QName getElementQName() { return ((NameImpl)getElementName()).toQName(); }
/** * The default implementation uses a DOMWriter. * SOAPContentElements overwrite this to optimize DOM callbacks. */ public void writeElement(Writer writer) throws IOException { String qualName = getElementName().getQualifiedName(); writer.write("<" + qualName); // namespaces Iterator<String> nsPrefixes = getNamespacePrefixes(); while (nsPrefixes.hasNext()) { String prefix = (String)nsPrefixes.next(); writer.write(" xmlns:" + prefix + "='" + getNamespaceURI(prefix) + "'"); } // attributes Iterator<Name> attNames = getAllAttributes(); while (attNames.hasNext()) { NameImpl name = (NameImpl)attNames.next(); String attPrefix = name.getPrefix() != null ? name.getPrefix() : ""; String attFqn = attPrefix.length() > 0 ? attPrefix + ":" + name.getLocalName() : name.getLocalName(); writer.write(" " + attFqn + "='" + getAttributeValue(name) + "'"); } writer.write(">"); writeElementContent(writer); writer.write("</" + qualName + ">"); }
/** Converts the given element to a Detail. */ DetailImpl(SOAPElementImpl element) { super(element.getElementName()); // altough detail schema does not define attributes, copy them for completeness DOMUtils.copyAttributes(this, element); try { NodeList nodeList = element.getChildNodes(); for (int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if (node instanceof SOAPElement) addChildElement((SOAPElement)node); else appendChild(node); } } catch (SOAPException e) { throw new WSException(BundleUtils.getMessage(bundle, "UNABLE_TO_CREATE_FAULT_DETAIL"), e); } }