Class ElementImpl
- java.lang.Object
-
- com.sun.xml.messaging.saaj.soap.impl.ElementImpl
-
- All Implemented Interfaces:
Node,SOAPBodyElement,SOAPElement,Element,Node
- Direct Known Subclasses:
BodyElementImpl,BodyImpl,DetailEntryImpl,EnvelopeImpl,FaultElementImpl,FaultImpl,HeaderElementImpl,HeaderImpl
public class ElementImpl extends Object implements SOAPElement, SOAPBodyElement
-
-
Field Summary
Fields Modifier and Type Field Description static StringDSIG_NSprotected QNameelementQNamestatic StringWSU_NSstatic StringXENC_NS-
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
-
-
Constructor Summary
Constructors Constructor Description ElementImpl(SOAPDocumentImpl ownerDoc, Name name)ElementImpl(SOAPDocumentImpl ownerDoc, String uri, String qualifiedName)ElementImpl(SOAPDocumentImpl ownerDoc, QName name)ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SOAPElementaddAttribute(Name name, String value)Adds an attribute with the specified name and value to thisSOAPElementobject.SOAPElementaddAttribute(QName qname, String value)Adds an attribute with the specified name and value to thisSOAPElementobject.protected SOAPElementaddCDATA(String text)SOAPElementaddChildElement(Name name)Creates a newSOAPElementobject initialized with the givenNameobject and adds the new element to thisSOAPElementobject.SOAPElementaddChildElement(SOAPElement element)Add aSOAPElementas a child of thisSOAPElementinstance.SOAPElementaddChildElement(String localName)Creates a newSOAPElementobject initialized with the specified local name and adds the new element to thisSOAPElementobject.SOAPElementaddChildElement(String localName, String prefix)Creates a newSOAPElementobject initialized with the specified local name and prefix and adds the new element to thisSOAPElementobject.SOAPElementaddChildElement(String localName, String prefix, String uri)Creates a newSOAPElementobject initialized with the specified local name, prefix, and URI and adds the new element to thisSOAPElementobject.SOAPElementaddChildElement(QName qname)Creates a newSOAPElementobject initialized with the givenQNameobject and adds the new element to thisSOAPElementobject.protected SOAPElementaddElement(Name name)protected SOAPElementaddElement(QName name)SOAPElementaddNamespaceDeclaration(String prefix, String uri)Adds a namespace declaration with the specified prefix and URI to thisSOAPElementobject.protected voidaddNode(Node newElement)protected SOAPElementaddText(String text)SOAPElementaddTextNode(String text)Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.NodeappendChild(Node newChild)NodecloneNode(boolean deep)shortcompareDocumentPosition(Node other)protected SOAPElementconvertToSoapElement(Element element)protected TextImplconvertToSoapText(CharacterData characterData)protected SOAPElementcreateElement(Name name)protected SOAPElementcreateElement(QName name)QNamecreateQName(String localName, String prefix)Creates aQNamewhose namespace URI is the one associated with the parameter,prefix, in the context of thisSOAPElement.voiddetachNode()Removes thisNodeobject from the tree.protected Iterator<String>doGetNamespacePrefixes(boolean deep)voidensureNamespaceIsDeclared(String prefix, String uri)protected SOAPElementfindAndConvertChildElement(NameImpl name)protected SOAPElementfindChild(NameImpl name)protected voidfindEncodingStyleAttributeName()Iterator<Name>getAllAttributes()Returns anIteratorover all of the attributeNameobjects in thisSOAPElementobject.Iterator<QName>getAllAttributesAsQNames()Returns anIteratorover all of the attributes in thisSOAPElementasQNameobjects.protected static Iterator<Name>getAllAttributesFrom(Element element)StringgetAttribute(String name)AttrgetAttributeNode(String name)AttrgetAttributeNodeNS(String namespaceURI, String localName)StringgetAttributeNS(String namespaceURI, String localName)NamedNodeMapgetAttributes()StringgetAttributeValue(Name name)Returns the value of the attribute with the specified name.StringgetAttributeValue(QName qname)Returns the value of the attribute with the specified qname.protected static StringgetAttributeValueFrom(Element element, Name name)StringgetBaseURI()protected Iterator<Node>getChildElementNodes()Iterator<Node>getChildElements()Returns anIteratorover all the immediate childNodes of this element.Iterator<Node>getChildElements(Name name)Returns anIteratorover all the immediate childNodes of this element with the specified name.Iterator<Node>getChildElements(QName qname)Returns anIteratorover all the immediate childNodes of this element with the specified qname.protected Iterator<Node>getChildElementsFrom(Element element)NodeListgetChildNodes()ElementgetDomElement()NamegetElementName()Returns the name of thisSOAPElementobject.QNamegetElementQName()Returns the qname of thisSOAPElementobject.NodeListgetElementsByTagName(String name)NodeListgetElementsByTagNameNS(String namespaceURI, String localName)StringgetEncodingStyle()Returns the encoding style for thisSOAPElementobject.ObjectgetFeature(String feature, String version)NodegetFirstChild()NodegetLastChild()StringgetLocalName()static StringgetLocalPart(String qualifiedName)protected AttrgetNamespaceAttr(String prefix)protected static AttrgetNamespaceAttrFrom(Element element, String prefix)NamespaceContextIteratorgetNamespaceContextNodes()NamespaceContextIteratorgetNamespaceContextNodes(boolean traverseStack)StringgetNamespacePrefix(String uri)Iterator<String>getNamespacePrefixes()Returns anIteratorover the namespace prefixStrings declared by this element.StringgetNamespaceURI()StringgetNamespaceURI(String prefix)Returns the URI of the namespace that has the given prefix.NodegetNextSibling()StringgetNodeName()shortgetNodeType()StringgetNodeValue()DocumentgetOwnerDocument()SOAPElementgetParentElement()Returns the parent element of thisNodeobject.NodegetParentNode()StringgetPrefix()static StringgetPrefix(String qualifiedName)NodegetPreviousSibling()static StringgetQualifiedName(QName name)TypeInfogetSchemaTypeInfo()SOAPDocumentImplgetSoapDocument()protected StringgetSOAPNamespace()StringgetTagName()StringgetTextContent()ObjectgetUserData(String key)StringgetValue()Returns the value of this node if this is aTextnode or the value of the immediate child of this node otherwise.protected NodegetValueNode()protected NodegetValueNodeStrict()Iterator<String>getVisibleNamespacePrefixes()Returns anIteratorover the namespace prefixStrings visible to this element.booleanhasAttribute(String name)booleanhasAttributeNS(String namespaceURI, String localName)booleanhasAttributes()booleanhasChildNodes()protected ElementimportElement(Element element)NodeinsertBefore(Node newChild, Node refChild)booleanisDefaultNamespace(String namespaceURI)booleanisEqualNode(Node arg)protected booleanisNamespaceQualified(Name name)protected booleanisNamespaceQualified(QName name)booleanisSameNode(Node other)booleanisSupported(String feature, String version)StringlookupNamespaceURI(String prefix)StringlookupPrefix(String namespaceURI)voidnormalize()voidrecycleNode()Notifies the implementation that thisNodeobject is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later.booleanremoveAttribute(Name name)Removes the attribute with the specified name.voidremoveAttribute(String name)booleanremoveAttribute(QName name)Removes the attribute with the specified qname.AttrremoveAttributeNode(Attr oldAttr)voidremoveAttributeNS(String namespaceURI, String localName)NoderemoveChild(Node oldChild)voidremoveContents()Detaches all children of thisSOAPElement.booleanremoveNamespaceDeclaration(String prefix)Removes the namespace declaration corresponding to the given prefix.NodereplaceChild(Node newChild, Node oldChild)protected SOAPElementreplaceElementWithSOAPElement(Element element, ElementImpl copy)voidsetAttribute(String name, String value)AttrsetAttributeNode(Attr newAttr)AttrsetAttributeNodeNS(Attr newAttr)voidsetAttributeNS(String namespaceURI, String qualifiedName, String value)SOAPElementsetElementQName(QName newName)Changes the name of thisElementtonewNameif possible.voidsetEncodingStyle(String encodingStyle)Sets the encoding style for thisSOAPElementobject to one specified.protected voidsetEncodingStyleNamespace(String soapNamespace, String soapNamespacePrefix)voidsetIdAttribute(String name, boolean isId)voidsetIdAttributeNode(Attr idAttr, boolean isId)voidsetIdAttributeNS(String namespaceURI, String localName, boolean isId)voidsetNodeValue(String nodeValue)voidsetParentElement(SOAPElement element)Sets the parent of thisNodeobject to the givenSOAPElementobject.voidsetPrefix(String prefix)voidsetTextContent(String textContent)ObjectsetUserData(String key, Object data, UserDataHandler handler)voidsetValue(String value)If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.voidtryToFindEncodingStyleAttributeName()
-
-
-
Field Detail
-
DSIG_NS
public static final String DSIG_NS
- See Also:
- Constant Field Values
-
XENC_NS
public static final String XENC_NS
- See Also:
- Constant Field Values
-
WSU_NS
public static final String WSU_NS
- See Also:
- Constant Field Values
-
elementQName
protected QName elementQName
-
-
Constructor Detail
-
ElementImpl
public ElementImpl(SOAPDocumentImpl ownerDoc, Name name)
-
ElementImpl
public ElementImpl(SOAPDocumentImpl ownerDoc, QName name)
-
ElementImpl
public ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement)
-
ElementImpl
public ElementImpl(SOAPDocumentImpl ownerDoc, String uri, String qualifiedName)
-
-
Method Detail
-
getTagName
public String getTagName()
- Specified by:
getTagNamein interfaceElement
-
getAttribute
public String getAttribute(String name)
- Specified by:
getAttributein interfaceElement
-
setAttribute
public void setAttribute(String name, String value) throws DOMException
- Specified by:
setAttributein interfaceElement- Throws:
DOMException
-
removeAttribute
public void removeAttribute(String name) throws DOMException
- Specified by:
removeAttributein interfaceElement- Throws:
DOMException
-
getAttributeNode
public Attr getAttributeNode(String name)
- Specified by:
getAttributeNodein interfaceElement
-
setAttributeNode
public Attr setAttributeNode(Attr newAttr) throws DOMException
- Specified by:
setAttributeNodein interfaceElement- Throws:
DOMException
-
removeAttributeNode
public Attr removeAttributeNode(Attr oldAttr) throws DOMException
- Specified by:
removeAttributeNodein interfaceElement- Throws:
DOMException
-
getElementsByTagName
public NodeList getElementsByTagName(String name)
- Specified by:
getElementsByTagNamein interfaceElement
-
getAttributeNS
public String getAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
getAttributeNSin interfaceElement- Throws:
DOMException
-
getOwnerDocument
public Document getOwnerDocument()
- Specified by:
getOwnerDocumentin interfaceNode
-
insertBefore
public Node insertBefore(Node newChild, Node refChild) throws DOMException
- Specified by:
insertBeforein interfaceNode- Throws:
DOMException
-
replaceChild
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- Specified by:
replaceChildin interfaceNode- Throws:
DOMException
-
removeChild
public Node removeChild(Node oldChild) throws DOMException
- Specified by:
removeChildin interfaceNode- Throws:
DOMException
-
appendChild
public Node appendChild(Node newChild) throws DOMException
- Specified by:
appendChildin interfaceNode- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()
- Specified by:
hasChildNodesin interfaceNode
-
isSupported
public boolean isSupported(String feature, String version)
- Specified by:
isSupportedin interfaceNode
-
getNamespaceURI
public String getNamespaceURI()
- Specified by:
getNamespaceURIin interfaceNode
-
setPrefix
public void setPrefix(String prefix) throws DOMException
- Specified by:
setPrefixin interfaceNode- Throws:
DOMException
-
getLocalName
public String getLocalName()
- Specified by:
getLocalNamein interfaceNode
-
hasAttributes
public boolean hasAttributes()
- Specified by:
hasAttributesin interfaceNode
-
getBaseURI
public String getBaseURI()
- Specified by:
getBaseURIin interfaceNode
-
compareDocumentPosition
public short compareDocumentPosition(Node other) throws DOMException
- Specified by:
compareDocumentPositionin interfaceNode- Throws:
DOMException
-
getTextContent
public String getTextContent() throws DOMException
- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
setTextContent
public void setTextContent(String textContent) throws DOMException
- Specified by:
setTextContentin interfaceNode- Throws:
DOMException
-
isSameNode
public boolean isSameNode(Node other)
- Specified by:
isSameNodein interfaceNode
-
lookupPrefix
public String lookupPrefix(String namespaceURI)
- Specified by:
lookupPrefixin interfaceNode
-
isDefaultNamespace
public boolean isDefaultNamespace(String namespaceURI)
- Specified by:
isDefaultNamespacein interfaceNode
-
lookupNamespaceURI
public String lookupNamespaceURI(String prefix)
- Specified by:
lookupNamespaceURIin interfaceNode
-
isEqualNode
public boolean isEqualNode(Node arg)
- Specified by:
isEqualNodein interfaceNode
-
getFeature
public Object getFeature(String feature, String version)
- Specified by:
getFeaturein interfaceNode
-
setUserData
public Object setUserData(String key, Object data, UserDataHandler handler)
- Specified by:
setUserDatain interfaceNode
-
getUserData
public Object getUserData(String key)
- Specified by:
getUserDatain interfaceNode
-
addChildElement
public SOAPElement addChildElement(Name name) throws SOAPException
Description copied from interface:SOAPElementCreates a newSOAPElementobject initialized with the givenNameobject and adds the new element to thisSOAPElementobject.This method may be deprecated in a future release of SAAJ in favor of addChildElement(javax.xml.namespace.QName)
- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
name- aNameobject with the XML name for the new element- Returns:
- the new
SOAPElementobject that was created - Throws:
SOAPException- if there is an error in creating theSOAPElementobject- See Also:
SOAPElement.addChildElement(javax.xml.namespace.QName)
-
addChildElement
public SOAPElement addChildElement(QName qname) throws SOAPException
Description copied from interface:SOAPElementCreates a newSOAPElementobject initialized with the givenQNameobject and adds the new element to thisSOAPElementobject. The namespace, localname and prefix of the newSOAPElementare all taken from theqnameargument.- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
qname- aQNameobject with the XML name for the new element- Returns:
- the new
SOAPElementobject that was created - Throws:
SOAPException- if there is an error in creating theSOAPElementobject- See Also:
SOAPElement.addChildElement(Name)
-
addChildElement
public SOAPElement addChildElement(String localName) throws SOAPException
Description copied from interface:SOAPElementCreates a newSOAPElementobject initialized with the specified local name and adds the new element to thisSOAPElementobject. The newSOAPElementinherits any in-scope default namespace.- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
localName- aStringgiving the local name for the element- Returns:
- the new
SOAPElementobject that was created - Throws:
SOAPException- if there is an error in creating theSOAPElementobject
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
Description copied from interface:SOAPElementCreates a newSOAPElementobject initialized with the specified local name and prefix and adds the new element to thisSOAPElementobject.- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
localName- aStringgiving the local name for the new elementprefix- aStringgiving the namespace prefix for the new element- Returns:
- the new
SOAPElementobject that was created - Throws:
SOAPException- if theprefixis not valid in the context of thisSOAPElementor if there is an error in creating theSOAPElementobject
-
getNamespaceURI
public String getNamespaceURI(String prefix)
Description copied from interface:SOAPElementReturns the URI of the namespace that has the given prefix.- Specified by:
getNamespaceURIin interfaceSOAPElement- Parameters:
prefix- aStringgiving the prefix of the namespace for which to search- Returns:
- a
Stringwith the uri of the namespace that has the given prefix
-
setElementQName
public SOAPElement setElementQName(QName newName) throws SOAPException
Description copied from interface:SOAPElementChanges the name of thisElementtonewNameif possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the
SOAPElementto a renamed instance.- Specified by:
setElementQNamein interfaceSOAPElement- Parameters:
newName- the new name for theElement.- Returns:
- The renamed Node
- Throws:
SOAPException- if changing the name of thisElementis not allowed.
-
createQName
public QName createQName(String localName, String prefix) throws SOAPException
Description copied from interface:SOAPElementCreates aQNamewhose namespace URI is the one associated with the parameter,prefix, in the context of thisSOAPElement. The remaining elements of the newQNameare taken directly from the parameters,localNameandprefix.- Specified by:
createQNamein interfaceSOAPElement- Parameters:
localName- aStringcontaining the local part of the name.prefix- aStringcontaining the prefix for the name.- Returns:
- a
QNamewith the specifiedlocalNameandprefix, and with a namespace that is associated with theprefixin the context of thisSOAPElement. This namespace will be the same as the one that would be returned bySOAPElement.getNamespaceURI(String)if it were givenprefixas it's parameter. - Throws:
SOAPException- if theQNamecannot be created.
-
getNamespaceContextNodes
public NamespaceContextIterator getNamespaceContextNodes()
-
getNamespaceContextNodes
public NamespaceContextIterator getNamespaceContextNodes(boolean traverseStack)
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
Description copied from interface:SOAPElementCreates a newSOAPElementobject initialized with the specified local name, prefix, and URI and adds the new element to thisSOAPElementobject.- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
localName- aStringgiving the local name for the new elementprefix- aStringgiving the namespace prefix for the new elementuri- aStringgiving the URI of the namespace to which the new element belongs- Returns:
- the new
SOAPElementobject that was created - Throws:
SOAPException- if there is an error in creating theSOAPElementobject
-
addChildElement
public SOAPElement addChildElement(SOAPElement element) throws SOAPException
Description copied from interface:SOAPElementAdd aSOAPElementas a child of thisSOAPElementinstance. TheSOAPElementis expected to be created by aSOAPFactory. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of theSOAPElementpassed into an instance of a differentSOAPElementimplementation. For instance ifaddChildElement()is called on aSOAPHeader,elementwill be copied into an instance of aSOAPHeaderElement.The fragment rooted in
elementis either added as a whole or not at all, if there was an error.The fragment rooted in
elementcannot 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.- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
element- theSOAPElementto be added as a new child- Returns:
- an instance representing the new SOAP element that was actually added to the tree.
- Throws:
SOAPException- if there was an error in adding this element as a child
-
addElement
protected SOAPElement addElement(Name name) throws SOAPException
- Throws:
SOAPException
-
addElement
protected SOAPElement addElement(QName name) throws SOAPException
- Throws:
SOAPException
-
createElement
protected SOAPElement createElement(Name name)
-
createElement
protected SOAPElement createElement(QName name)
-
addNode
protected void addNode(Node newElement) throws SOAPException
- Throws:
SOAPException
-
findChild
protected SOAPElement findChild(NameImpl name)
-
findAndConvertChildElement
protected SOAPElement findAndConvertChildElement(NameImpl name)
-
addTextNode
public SOAPElement addTextNode(String text) throws SOAPException
Description copied from interface:SOAPElementCreates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.- Specified by:
addTextNodein interfaceSOAPElement- Parameters:
text- aStringobject with the textual content to be added- Returns:
- the
SOAPElementobject into which the newTextobject was inserted - Throws:
SOAPException- if there is an error in creating the newTextobject or if it is not legal to attach it as a child to thisSOAPElement
-
addCDATA
protected SOAPElement addCDATA(String text) throws SOAPException
- Throws:
SOAPException
-
addText
protected SOAPElement addText(String text) throws SOAPException
- Throws:
SOAPException
-
addAttribute
public SOAPElement addAttribute(Name name, String value) throws SOAPException
Description copied from interface:SOAPElementAdds an attribute with the specified name and value to thisSOAPElementobject.- Specified by:
addAttributein interfaceSOAPElement- Parameters:
name- aNameobject with the name of the attributevalue- aStringgiving the value of the attribute- Returns:
- the
SOAPElementobject into which the attribute was inserted - Throws:
SOAPException- if there is an error in creating the Attribute, or it is invalid to set an attribute withNamenameon this SOAPElement.- See Also:
SOAPElement.addAttribute(javax.xml.namespace.QName, String)
-
addAttribute
public SOAPElement addAttribute(QName qname, String value) throws SOAPException
Description copied from interface:SOAPElementAdds an attribute with the specified name and value to thisSOAPElementobject.- Specified by:
addAttributein interfaceSOAPElement- Parameters:
qname- aQNameobject with the name of the attributevalue- aStringgiving the value of the attribute- Returns:
- the
SOAPElementobject into which the attribute was inserted - Throws:
SOAPException- if there is an error in creating the Attribute, or it is invalid to set an attribute withQNameqnameon this SOAPElement.- See Also:
SOAPElement.addAttribute(Name, String)
-
addNamespaceDeclaration
public SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException
Description copied from interface:SOAPElementAdds a namespace declaration with the specified prefix and URI to thisSOAPElementobject.- Specified by:
addNamespaceDeclarationin interfaceSOAPElement- Parameters:
prefix- aStringgiving the prefix of the namespaceuri- aStringgiving the uri of the namespace- Returns:
- the
SOAPElementobject into which this namespace declaration was inserted. - Throws:
SOAPException- if there is an error in creating the namespace
-
getAttributeValue
public String getAttributeValue(Name name)
Description copied from interface:SOAPElementReturns the value of the attribute with the specified name.- Specified by:
getAttributeValuein interfaceSOAPElement- Parameters:
name- aNameobject with the name of the attribute- Returns:
- a
Stringgiving the value of the specified attribute, Null if there is no such attribute - See Also:
SOAPElement.getAttributeValue(javax.xml.namespace.QName)
-
getAttributeValue
public String getAttributeValue(QName qname)
Description copied from interface:SOAPElementReturns the value of the attribute with the specified qname.- Specified by:
getAttributeValuein interfaceSOAPElement- Parameters:
qname- aQNameobject with the qname of the attribute- Returns:
- a
Stringgiving the value of the specified attribute, Null if there is no such attribute - See Also:
SOAPElement.getAttributeValue(Name)
-
getAllAttributes
public Iterator<Name> getAllAttributes()
Description copied from interface:SOAPElementReturns anIteratorover all of the attributeNameobjects in thisSOAPElementobject. The iterator can be used to get the attribute names, which can then be passed to the methodgetAttributeValueto retrieve the value of each attribute.- Specified by:
getAllAttributesin interfaceSOAPElement- Returns:
- an iterator over the names of the attributes
- See Also:
SOAPElement.getAllAttributesAsQNames()
-
getAllAttributesAsQNames
public Iterator<QName> getAllAttributesAsQNames()
Description copied from interface:SOAPElementReturns anIteratorover all of the attributes in thisSOAPElementasQNameobjects. The iterator can be used to get the attribute QName, which can then be passed to the methodgetAttributeValueto retrieve the value of each attribute.- Specified by:
getAllAttributesAsQNamesin interfaceSOAPElement- Returns:
- an iterator over the QNames of the attributes
- See Also:
SOAPElement.getAllAttributes()
-
getNamespacePrefixes
public Iterator<String> getNamespacePrefixes()
Description copied from interface:SOAPElementReturns anIteratorover the namespace prefixStrings declared by this element. The prefixes returned by this iterator can be passed to the methodgetNamespaceURIto retrieve the URI of each namespace.- Specified by:
getNamespacePrefixesin interfaceSOAPElement- Returns:
- an iterator over the namespace prefixes in this
SOAPElementobject
-
getVisibleNamespacePrefixes
public Iterator<String> getVisibleNamespacePrefixes()
Description copied from interface:SOAPElementReturns anIteratorover the namespace prefixStrings visible to this element. The prefixes returned by this iterator can be passed to the methodgetNamespaceURIto retrieve the URI of each namespace.- Specified by:
getVisibleNamespacePrefixesin interfaceSOAPElement- Returns:
- an iterator over the namespace prefixes are within scope of this
SOAPElementobject
-
getElementName
public Name getElementName()
Description copied from interface:SOAPElementReturns the name of thisSOAPElementobject.- Specified by:
getElementNamein interfaceSOAPElement- Returns:
- a
Nameobject with the name of thisSOAPElementobject
-
getElementQName
public QName getElementQName()
Description copied from interface:SOAPElementReturns the qname of thisSOAPElementobject.- Specified by:
getElementQNamein interfaceSOAPElement- Returns:
- a
QNameobject with the qname of thisSOAPElementobject - See Also:
SOAPElement.getElementName()
-
removeAttribute
public boolean removeAttribute(Name name)
Description copied from interface:SOAPElementRemoves the attribute with the specified name.- Specified by:
removeAttributein interfaceSOAPElement- Parameters:
name- theNameobject with the name of the attribute to be removed- Returns:
trueif the attribute was removed successfully;falseif it was not- See Also:
SOAPElement.removeAttribute(javax.xml.namespace.QName)
-
removeAttribute
public boolean removeAttribute(QName name)
Description copied from interface:SOAPElementRemoves the attribute with the specified qname.- Specified by:
removeAttributein interfaceSOAPElement- Parameters:
name- theQNameobject with the qname of the attribute to be removed- Returns:
trueif the attribute was removed successfully;falseif it was not- See Also:
SOAPElement.removeAttribute(Name)
-
removeNamespaceDeclaration
public boolean removeNamespaceDeclaration(String prefix)
Description copied from interface:SOAPElementRemoves the namespace declaration corresponding to the given prefix.- Specified by:
removeNamespaceDeclarationin interfaceSOAPElement- Parameters:
prefix- aStringgiving the prefix for which to search- Returns:
trueif the namespace declaration was removed successfully;falseif it was not
-
getChildElements
public Iterator<Node> getChildElements()
Description copied from interface:SOAPElementReturns anIteratorover all the immediate childNodes of this element. This includesjakarta.xml.soap.Textobjects as well asSOAPElementobjects.Calling this method must cause child
Element,SOAPElementandorg.w3c.dom.Textnodes to be replaced bySOAPElement,SOAPHeaderElement,SOAPBodyElementorjakarta.xml.soap.Textnodes 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 thisIterator. This behavior can be avoided by calling the equivalent DOM APIs. Seejakarta.xml.soapfor more details.- Specified by:
getChildElementsin interfaceSOAPElement- Returns:
- an iterator with the content of this
SOAPElementobject
-
convertToSoapElement
protected SOAPElement convertToSoapElement(Element element)
-
convertToSoapText
protected TextImpl convertToSoapText(CharacterData characterData)
-
replaceElementWithSOAPElement
protected SOAPElement replaceElementWithSOAPElement(Element element, ElementImpl copy)
-
getChildElements
public Iterator<Node> getChildElements(Name name)
Description copied from interface:SOAPElementReturns anIteratorover all the immediate childNodes of this element with the specified name. All of these children will beSOAPElementnodes.Calling this method must cause child
Element,SOAPElementandorg.w3c.dom.Textnodes to be replaced bySOAPElement,SOAPHeaderElement,SOAPBodyElementorjakarta.xml.soap.Textnodes 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 thisIterator. This behavior can be avoided by calling the equivalent DOM APIs. Seejakarta.xml.soapfor more details.- Specified by:
getChildElementsin interfaceSOAPElement- Parameters:
name- aNameobject with the name of the child elements to be returned- Returns:
- an
Iteratorobject over all the elements in thisSOAPElementobject with the specified name - See Also:
SOAPElement.getChildElements(javax.xml.namespace.QName)
-
getChildElements
public Iterator<Node> getChildElements(QName qname)
Description copied from interface:SOAPElementReturns anIteratorover all the immediate childNodes of this element with the specified qname. All of these children will beSOAPElementnodes.Calling this method must cause child
Element,SOAPElementandorg.w3c.dom.Textnodes to be replaced bySOAPElement,SOAPHeaderElement,SOAPBodyElementorjakarta.xml.soap.Textnodes 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 thisIterator. This behavior can be avoided by calling the equivalent DOM APIs. Seejakarta.xml.soapfor more details.- Specified by:
getChildElementsin interfaceSOAPElement- Parameters:
qname- aQNameobject with the qname of the child elements to be returned- Returns:
- an
Iteratorobject over all the elements in thisSOAPElementobject with the specified qname - See Also:
SOAPElement.getChildElements(Name)
-
removeContents
public void removeContents()
Description copied from interface:SOAPElementDetaches all children of thisSOAPElement.This method is useful for rolling back the construction of partially completed
SOAPHeadersandSOAPBodysin 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.- Specified by:
removeContentsin interfaceSOAPElement
-
setEncodingStyle
public void setEncodingStyle(String encodingStyle) throws SOAPException
Description copied from interface:SOAPElementSets the encoding style for thisSOAPElementobject to one specified.- Specified by:
setEncodingStylein interfaceSOAPElement- Parameters:
encodingStyle- aStringgiving the encoding style- Throws:
SOAPException- if setting the encodingStyle is invalid for this SOAPElement.- See Also:
SOAPElement.getEncodingStyle()
-
getEncodingStyle
public String getEncodingStyle()
Description copied from interface:SOAPElementReturns the encoding style for thisSOAPElementobject.- Specified by:
getEncodingStylein interfaceSOAPElement- Returns:
- a
Stringgiving the encoding style - See Also:
SOAPElement.setEncodingStyle(java.lang.String)
-
getValue
public String getValue()
Description copied from interface:NodeReturns the value of this node if this is aTextnode or the value of the immediate child of this node otherwise. If there is an immediate child of thisNodethat it is aTextnode then it's value will be returned. If there is more than oneTextnode then the value of the firstTextNode will be returned. Otherwisenullis returned.
-
setValue
public void setValue(String value)
Description copied from interface:NodeIf this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node. The value of the immediate child of this node can be set only if, there is one child node and that node is aTextnode, or if there are no children in which case a childTextnode will be created.
-
getValueNodeStrict
protected Node getValueNodeStrict()
-
getValueNode
protected Node getValueNode()
-
setParentElement
public void setParentElement(SOAPElement element) throws SOAPException
Description copied from interface:NodeSets the parent of thisNodeobject to the givenSOAPElementobject.- Specified by:
setParentElementin interfaceNode- Parameters:
element- theSOAPElementobject to be set as the parent of thisNodeobject- Throws:
SOAPException- if there is a problem in setting the parent to the given element- See Also:
Node.getParentElement()
-
findEncodingStyleAttributeName
protected void findEncodingStyleAttributeName() throws SOAPException- Throws:
SOAPException
-
setEncodingStyleNamespace
protected void setEncodingStyleNamespace(String soapNamespace, String soapNamespacePrefix) throws SOAPException
- Throws:
SOAPException
-
getParentElement
public SOAPElement getParentElement()
Description copied from interface:NodeReturns the parent element of thisNodeobject. This method can throw anUnsupportedOperationExceptionif the tree is not kept in memory.- Specified by:
getParentElementin interfaceNode- Returns:
- the
SOAPElementobject that is the parent of thisNodeobject ornullif thisNodeobject is root - See Also:
Node.setParentElement(jakarta.xml.soap.SOAPElement)
-
getSOAPNamespace
protected String getSOAPNamespace()
-
detachNode
public void detachNode()
Description copied from interface:NodeRemoves thisNodeobject from the tree.- Specified by:
detachNodein interfaceNode
-
tryToFindEncodingStyleAttributeName
public void tryToFindEncodingStyleAttributeName()
-
recycleNode
public void recycleNode()
Description copied from interface:NodeNotifies the implementation that thisNodeobject is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later.Calling the method
recycleNodeimplies that the methoddetachNodehas been called previously.- Specified by:
recycleNodein interfaceNode
-
isNamespaceQualified
protected boolean isNamespaceQualified(Name name)
-
isNamespaceQualified
protected boolean isNamespaceQualified(QName name)
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value)
- Specified by:
setAttributeNSin interfaceElement
-
removeAttributeNS
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
removeAttributeNSin interfaceElement- Throws:
DOMException
-
getAttributeNodeNS
public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
getAttributeNodeNSin interfaceElement- Throws:
DOMException
-
setAttributeNodeNS
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- Specified by:
setAttributeNodeNSin interfaceElement- Throws:
DOMException
-
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException
- Specified by:
getElementsByTagNameNSin interfaceElement- Throws:
DOMException
-
hasAttribute
public boolean hasAttribute(String name)
- Specified by:
hasAttributein interfaceElement
-
hasAttributeNS
public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
hasAttributeNSin interfaceElement- Throws:
DOMException
-
getSchemaTypeInfo
public TypeInfo getSchemaTypeInfo()
- Specified by:
getSchemaTypeInfoin interfaceElement
-
setIdAttribute
public void setIdAttribute(String name, boolean isId) throws DOMException
- Specified by:
setIdAttributein interfaceElement- Throws:
DOMException
-
setIdAttributeNS
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
- Specified by:
setIdAttributeNSin interfaceElement- Throws:
DOMException
-
setIdAttributeNode
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
- Specified by:
setIdAttributeNodein interfaceElement- Throws:
DOMException
-
getNodeName
public String getNodeName()
- Specified by:
getNodeNamein interfaceNode
-
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
getNodeValuein interfaceNode- Throws:
DOMException
-
setNodeValue
public void setNodeValue(String nodeValue) throws DOMException
- Specified by:
setNodeValuein interfaceNode- Throws:
DOMException
-
getNodeType
public short getNodeType()
- Specified by:
getNodeTypein interfaceNode
-
getParentNode
public Node getParentNode()
- Specified by:
getParentNodein interfaceNode
-
getChildNodes
public NodeList getChildNodes()
- Specified by:
getChildNodesin interfaceNode
-
getFirstChild
public Node getFirstChild()
- Specified by:
getFirstChildin interfaceNode
-
getLastChild
public Node getLastChild()
- Specified by:
getLastChildin interfaceNode
-
getPreviousSibling
public Node getPreviousSibling()
- Specified by:
getPreviousSiblingin interfaceNode
-
getNextSibling
public Node getNextSibling()
- Specified by:
getNextSiblingin interfaceNode
-
getAttributes
public NamedNodeMap getAttributes()
- Specified by:
getAttributesin interfaceNode
-
getDomElement
public Element getDomElement()
-
getSoapDocument
public SOAPDocumentImpl getSoapDocument()
-
-