is new.
public interface SOAPElement
An object representing an element of a SOAP message that is allowed but not specifically prescribed by a SOAP specification. This interface serves as the base interface for those objects that are specifically prescribed by a SOAP specification.
Methods in this interface that are required to return SAAJ specific objects may "silently" replace nodes in the tree as required to successfully return objects of the correct type. See
getChildElements()
and
javax.xml.soap
for details.
| Field Summary |
|---|
| Fields inherited from interface org.w3c.dom. Node |
|---|
| ATTRIBUTE_NODE , CDATA_SECTION_NODE , COMMENT_NODE , DOCUMENT_FRAGMENT_NODE , DOCUMENT_NODE , DOCUMENT_POSITION_CONTAINED_BY , DOCUMENT_POSITION_CONTAINS , DOCUMENT_POSITION_DISCONNECTED , DOCUMENT_POSITION_FOLLOWING , DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC , DOCUMENT_POSITION_PRECEDING , DOCUMENT_TYPE_NODE , ELEMENT_NODE , ENTITY_NODE , ENTITY_REFERENCE_NODE , NOTATION_NODE , PROCESSING_INSTRUCTION_NODE , TEXT_NODE |
| Method Summary | |
|---|---|
| SOAPElement |
addAttribute
(
Name
name,
String
value) Adds an attribute with the specified name and value to this SOAPElement object. |
| SOAPElement |
addAttribute
(
QName
qname,
String
value) Adds an attribute with the specified name and value to this SOAPElement object. |
| SOAPElement |
addChildElement
(
Name
name) Creates a new SOAPElement object initialized with the given Name object and adds the new element to this SOAPElement object. |
| SOAPElement |
addChildElement
(
QName
qname) Creates a new SOAPElement object initialized with the given QName object and adds the new element to this SOAPElement object. |
| SOAPElement |
addChildElement
(
SOAPElement
element) Add a SOAPElement as a child of this SOAPElement instance. |
| SOAPElement |
addChildElement
(
String
localName) Creates a new SOAPElement object initialized with the specified local name and adds the new element to this SOAPElement object. |
| SOAPElement |
addChildElement
(
String
localName,
String
prefix) Creates a new SOAPElement object initialized with the specified local name and prefix and adds the new element to this SOAPElement object. |
| SOAPElement |
addChildElement
(
String
localName,
String
prefix,
String
uri) Creates a new SOAPElement object initialized with the specified local name, prefix, and URI and adds the new element to this SOAPElement object. |
| SOAPElement |
addNamespaceDeclaration
(
String
prefix,
String
uri) Adds a namespace declaration with the specified prefix and URI to this SOAPElement object. |
| SOAPElement |
addTextNode
(
String
text) Creates a new Text object initialized with the given String and adds it to this SOAPElement object. |
| QName |
createQName
(
String
localName,
String
prefix) Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement. |
| Iterator |
getAllAttributes
() Returns an Iterator over all of the attribute Name objects in this SOAPElement object. |
Iterator
|
getAllAttributesAsQNames
()
Returns an Iterator over all of the attributes in this SOAPElement as QName objects.
|
| String |
getAttributeValue
(
Name
name) Returns the value of the attribute with the specified name. |
| String |
getAttributeValue
(
QName
qname) Returns the value of the attribute with the specified qname. |
| Iterator |
getChildElements
() Returns an Iterator over all the immediate child Node s of this element. |
| Iterator |
getChildElements
(
Name
name) Returns an Iterator over all the immediate child Node s of this element with the specified name. |
| Iterator |
getChildElements
(
QName
qname) Returns an Iterator over all the immediate child Node s of this element with the specified qname. |
| Name |
getElementName
() Returns the name of this SOAPElement object. |
| QName |
getElementQName
() Returns the qname of this SOAPElement object. |
| String |
getEncodingStyle
() Returns the encoding style for this SOAPElement object. |
| Iterator |
getNamespacePrefixes
() Returns an Iterator over the namespace prefix Strings declared by this element. |
| String |
getNamespaceURI
(
String
prefix) Returns the URI of the namespace that has the given prefix. |
| Iterator |
getVisibleNamespacePrefixes
() Returns an Iterator over the namespace prefix Strings visible to this element. |
| boolean |
removeAttribute
(
Name
name) Removes the attribute with the specified name. |
| boolean |
removeAttribute
(
QName
qname) Removes the attribute with the specified qname. |
| void |
removeContents
() Detaches all children of this SOAPElement. |
| boolean |
removeNamespaceDeclaration
(
String
prefix) Removes the namespace declaration corresponding to the given prefix. |
| SOAPElement |
setElementQName
(
QName
newName) Changes the name of this Element to newName if possible. |
| void |
setEncodingStyle
(
String
encodingStyle) Sets the encoding style for this SOAPElement object to one specified. |
| Methods inherited from interface javax.xml.soap. Node |
|---|
| detachNode , getParentElement , getValue , recycleNode , setParentElement , setValue |
| Methods inherited from interface org.w3c.dom. Element |
|---|
| getAttribute , getAttributeNode , getAttributeNodeNS , getAttributeNS , getElementsByTagName , getElementsByTagNameNS , getSchemaTypeInfo , getTagName , hasAttribute , hasAttributeNS , removeAttribute , removeAttributeNode , removeAttributeNS , setAttribute , setAttributeNode , setAttributeNodeNS , setAttributeNS , setIdAttribute , setIdAttributeNode , setIdAttributeNS |
| Methods inherited from interface org.w3c.dom. Node |
|---|
| appendChild , cloneNode , compareDocumentPosition , getAttributes , getBaseURI , getChildNodes , getFeature , getFirstChild , getLastChild , getLocalName , getNamespaceURI , getNextSibling , getNodeName , getNodeType , getNodeValue , getOwnerDocument , getParentNode , getPrefix , getPreviousSibling , getTextContent , getUserData , hasAttributes , hasChildNodes , insertBefore , isDefaultNamespace , isEqualNode , isSameNode , isSupported , lookupNamespaceURI , lookupPrefix , normalize , removeChild , replaceChild , setNodeValue , setPrefix , setTextContent , setUserData |
| Method Detail |
|---|
SOAPElement addChildElement(Name name)
throws SOAPException
This method may be deprecated in a future release of SAAJ in favor of addChildElement(javax.xml.namespace.QName)
SOAPElement addChildElement(QName qname)
throws SOAPException
SAAJ 1.3
SOAPElement addChildElement(String localName)
throws SOAPException
SOAPElement addChildElement(String localName,
String prefix)
throws SOAPException
SOAPElement addChildElement(String localName,
String prefix,
String uri)
throws SOAPException
SOAPElement addChildElement(SOAPElement element)
throws SOAPException
The fragment rooted in element is either added as a whole or not at all, if there was an error.
The fragment rooted in element cannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.
void removeContents()
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.
SAAJ 1.2
SOAPElement addTextNode(String text)
throws SOAPException
SOAPElement addAttribute(Name name,
String value)
throws SOAPException
SOAPElement addAttribute(QName qname,
String value)
throws SOAPException
SAAJ 1.3
SOAPElement addNamespaceDeclaration(String prefix,
String uri)
throws SOAPException
String getAttributeValue(Name name)
String getAttributeValue(QName qname)
SAAJ 1.3
Iterator getAllAttributes()
See Also:
getAllAttributesAsQNames()
getAllAttributesAsQNames
Iterator
getAllAttributesAsQNames
()
Returns an Iterator over all of the attributes in this SOAPElement as QName objects. The iterator can be used to get the attribute QName, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.
Returns:
an iterator over the QNames of the attributes
Since:
SAAJ 1.3
See Also:
getAllAttributes()
String getNamespaceURI(String prefix)
Iterator getNamespacePrefixes()
Iterator getVisibleNamespacePrefixes()
SAAJ 1.2
QName createQName(String localName,
String prefix)
throws SOAPException
SAAJ 1.3
Name getElementName()
QName getElementQName()
SAAJ 1.3
SOAPElement setElementQName(QName newName)
throws SOAPException
Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the SOAPElement to a renamed instance.
SAAJ 1.3
boolean removeAttribute(Name name)
boolean removeAttribute(QName qname)
SAAJ 1.3
boolean removeNamespaceDeclaration(String prefix)
Iterator getChildElements()
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.
Iterator getChildElements(Name name)
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.
Iterator getChildElements(QName qname)
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.
javax.xml.soap
for more details.
void setEncodingStyle(String encodingStyle)
throws SOAPException
String getEncodingStyle()