@Override public Name createName(String localName) throws SOAPException { return new NameImpl(localName); }
/** * Gets the namespace-qualified name of the XML name that this Name object represents. * * @return the namespace-qualified name as a string */ public String getQualifiedName() { String prefix = getPrefix(); if (prefix.length() > 0) return prefix + ":" + qname.getLocalPart(); else return qname.getLocalPart(); }
/** * 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 + ">"); }
/** Creates a new SOAPHeaderElement object initialized with the specified name and adds it to this SOAPHeader object. */ public SOAPHeaderElement addHeaderElement(Name name) throws SOAPException { if (name == null) throw new SOAPException(BundleUtils.getMessage(bundle, "INVALID_SOAPHEADERELEMENT_NAME", name)); return addHeaderElement(new NameImpl(name.getLocalName(), name.getPrefix(), name.getURI()).toQName()); }
/** Sets this SOAPFault object with the given fault code. */ public void setFaultCode(Name faultCode) throws SOAPException { setFaultCode(((NameImpl)faultCode).toQName()); }
public QName getElementQName() { return ((NameImpl)getElementName()).toQName(); }
public Name createName(String localName) throws SOAPException { return new NameImpl(localName); }
public Name createName(String localName, String prefix, String uri) throws SOAPException { return new NameImpl(localName, prefix, uri); }
@Override public Name createName(String localName, String prefix, String uri) throws SOAPException { return new NameImpl(localName, prefix, uri); }
public SOAPFaultImpl(String prefix, String namespace) throws SOAPException { super(new NameImpl("Fault", prefix, namespace)); }
/** * Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object. * * @param name a String giving the local name for the element * @return the new SOAPElement object that was created * @throws javax.xml.soap.SOAPException if there is an error in creating the SOAPElement object */ public SOAPElement addChildElement(String name) throws SOAPException { Name nameImp = new NameImpl(name); return addChildElement(nameImp); }
/** * Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object. */ public Name getFaultCodeAsName() { return new NameImpl(getFaultCodeAsQName()); }
@Override public SOAPElement createElement(QName qname) throws SOAPException { return createElement(new NameImpl(qname)); }
public boolean removeAttribute(QName qname) { return removeAttribute(new NameImpl(qname)); }
public SOAPElement addChildElement(QName qname) throws SOAPException { return addChildElement(new NameImpl(qname)); }
public String getAttributeValue(QName qname) { return getAttributeValue(new NameImpl(qname)); }
/** * Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object. * * @param localName a String giving the local name for the new element * @param prefix a String giving the namespace prefix for the new element * @param uri a String giving the URI of the namespace to which the new element belongs * @return the new SOAPElement object that was created * @throws javax.xml.soap.SOAPException if there is an error in creating the SOAPElement object */ public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException { Name nameImpl = new NameImpl(localName, prefix, uri); return addChildElement(nameImpl); }
public SOAPElement addAttribute(QName qname, String value) throws SOAPException { return addAttribute(new NameImpl(qname), value); }
/** * Returns the name of this SOAPElement object. * * @return a Name object with the name of this SOAPElement object */ public Name getElementName() { if (elementName == null) { String nsURI = element.getNamespaceURI(); if (nsURI != null && nsURI.length() > 0) { String prefix = element.getPrefix(); String localName = element.getLocalName(); elementName = new NameImpl(localName, prefix, nsURI); } else { String nodeName = element.getNodeName(); elementName = new NameImpl(nodeName); } } return elementName; }