org.apache.axis2.saaj
Class SOAPElementImpl

java.lang.Object
  extended byorg.apache.axis2.saaj.NodeImpl
      extended byorg.apache.axis2.saaj.SOAPElementImpl
All Implemented Interfaces:
org.w3c.dom.Element, org.w3c.dom.Node, javax.xml.soap.Node, javax.xml.soap.SOAPElement
Direct Known Subclasses:
DetailEntryImpl, SOAPBodyElementImpl, SOAPBodyImpl, SOAPEnvelopeImpl, SOAPFaultElementImpl, SOAPHeaderElementImpl, SOAPHeaderImpl

public class SOAPElementImpl
extends NodeImpl
implements javax.xml.soap.SOAPElement

Class SOAPElementImpl


Field Summary
protected  OMElement omElement
          Field omElement The corresponding OM object for SOAPElement is OMElement, so we would have a datamember of type OMElement in this class
 
Fields inherited from class org.apache.axis2.saaj.NodeImpl
document, omNode
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
SOAPElementImpl()
          Constructor SOAPElementImpl The empty constructor
SOAPElementImpl(OMElement omElement)
          Constructor SOAPElementImpl The standard constructor for being able to create SOAPElement given a omElement
 
Method Summary
 javax.xml.soap.SOAPElement addAttribute(javax.xml.soap.Name name, java.lang.String value)
          Method addAttribute This method adds an attribute to the underlying omElement datamember and returns ourselves
 javax.xml.soap.SOAPElement addChildElement(javax.xml.soap.Name name)
          Method addChildElement
 javax.xml.soap.SOAPElement addChildElement(javax.xml.soap.SOAPElement element)
          Method addChildElement
 javax.xml.soap.SOAPElement addChildElement(java.lang.String localName)
          Method addChildElement
 javax.xml.soap.SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix)
          Method addChildElement
 javax.xml.soap.SOAPElement addChildElement(java.lang.String localName, java.lang.String prefix, java.lang.String uri)
          Method addChildElement
 javax.xml.soap.SOAPElement addNamespaceDeclaration(java.lang.String prefix, java.lang.String uri)
          Method addNamespaceDeclaration
 javax.xml.soap.SOAPElement addTextNode(java.lang.String text)
          Method addTextNode
 java.util.Iterator getAllAttributes()
          Method getAllAttributes
 java.lang.String getAttribute(java.lang.String name)
          method getAttribute This method retrieves the value of an attribute having specified localname.
 org.w3c.dom.Attr getAttributeNode(java.lang.String localName)
          method getAttributeNode This method retrieves an attribute node by the specified localname
 org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
          method getAttributeNodeNS This method retrieves an org.w3c.dom.Attr node matching the specified namespaceURI and localName
 java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          method getAttributeNS This method retrieves the value of the attribute matching the specified namespaceURI, and localName
 java.lang.String getAttributeValue(javax.xml.soap.Name name)
          Method getAttributeValue
 java.util.Iterator getChildElements()
          method getChildElements
 java.util.Iterator getChildElements(javax.xml.soap.Name name)
          method getChildElements
 javax.xml.soap.Name getElementName()
          Method getElementName
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String localName)
          Method getElementsByTagName Returns a NodeList of all the descendant Elements with the given local name, in the order in which they are encountered in a preorder traversal of this Element tree.
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
          getElementsByTagNameNS Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree.
 java.lang.String getEncodingStyle()
          method getEncodingStyle
 java.util.Iterator getNamespacePrefixes()
          method getNamespacePrefixes This method returns an iterator over all the declared namespaces prefix names.
 java.lang.String getNamespaceURI(java.lang.String prefix)
          Method getNamespaceURI
 OMElement getOMElement()
          Method getOMElement getter method on the data member omElement
 java.lang.String getTagName()
          method getTagName
 java.util.Iterator getVisibleNamespacePrefixes()
          method getVisibleNamespacePrefixes
 boolean hasAttribute(java.lang.String localName)
          method hasAttribute This method returns true when an attribute with a given name is specified on this element, false otherwise.
 boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          method hasAttributeNS This method returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.
 boolean removeAttribute(javax.xml.soap.Name name)
          method removeAttribute This method removes an attribute with the specified name from the element.
 void removeAttribute(java.lang.String localName)
          method removeAttribute
 org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
          method removeAttributeNode This method removes the specified attribute node from this element.
 void removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
           
 void removeContents()
          method removeContents
 boolean removeNamespaceDeclaration(java.lang.String prefix)
          method removeNamespaceDeclaration
 void setAttribute(java.lang.String localName, java.lang.String value)
          Method setAttribute This method creates and adds an attribute with the given localName and value into the underlying OM.
 org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr attr)
          Method setAttributeNode This method creates and adds an attribute corresponding to the supplied Attr object into the underlying OM.
 org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr attr)
          Method setAttributeNode This method creates and adds an attribute corresponding to the supplied Attr object into the underlying OM.
 void setAttributeNS(java.lang.String namespaceURI, java.lang.String localName, java.lang.String value)
          Method setAttributeNS This method creates and adds an attribute with the given namespaceURI, localName and value into the underlying OM.
 void setEncodingStyle(java.lang.String encodingStyle)
          method setEncodingStyle
 
Methods inherited from class org.apache.axis2.saaj.NodeImpl
appendChild, cloneNode, detachNode, equals, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOMNode, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getValue, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, recycleNode, removeChild, replaceChild, setNodeValue, setOwnerDocument, setParentElement, setPrefix, setValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

omElement

protected OMElement omElement
Field omElement The corresponding OM object for SOAPElement is OMElement, so we would have a datamember of type OMElement in this class

Constructor Detail

SOAPElementImpl

public SOAPElementImpl(OMElement omElement)
Constructor SOAPElementImpl The standard constructor for being able to create SOAPElement given a omElement

Parameters:
omElement -

SOAPElementImpl

public SOAPElementImpl()
Constructor SOAPElementImpl The empty constructor

Method Detail

getOMElement

public OMElement getOMElement()
Method getOMElement getter method on the data member omElement

Returns:

addChildElement

public javax.xml.soap.SOAPElement addChildElement(javax.xml.soap.Name name)
                                           throws javax.xml.soap.SOAPException
Method addChildElement

Specified by:
addChildElement in interface javax.xml.soap.SOAPElement
Parameters:
name -
Returns:
SOAPElement
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addChildElement(javax.xml.soap.Name)

addChildElement

public javax.xml.soap.SOAPElement addChildElement(java.lang.String localName)
                                           throws javax.xml.soap.SOAPException
Method addChildElement

Specified by:
addChildElement in interface javax.xml.soap.SOAPElement
Parameters:
localName -
Returns:
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addChildElement(java.lang.String)

addChildElement

public javax.xml.soap.SOAPElement addChildElement(java.lang.String localName,
                                                  java.lang.String prefix)
                                           throws javax.xml.soap.SOAPException
Method addChildElement

Specified by:
addChildElement in interface javax.xml.soap.SOAPElement
Parameters:
localName -
prefix -
Returns:
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addChildElement(java.lang.String, java.lang.String)

addChildElement

public javax.xml.soap.SOAPElement addChildElement(java.lang.String localName,
                                                  java.lang.String prefix,
                                                  java.lang.String uri)
                                           throws javax.xml.soap.SOAPException
Method addChildElement

Specified by:
addChildElement in interface javax.xml.soap.SOAPElement
Parameters:
localName -
prefix -
uri - a String giving the URI of the namespace to which the new element belongs
Returns:
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addChildElement(java.lang.String, java.lang.String, java.lang.String)

addChildElement

public javax.xml.soap.SOAPElement addChildElement(javax.xml.soap.SOAPElement element)
                                           throws javax.xml.soap.SOAPException
Method addChildElement

Specified by:
addChildElement in interface javax.xml.soap.SOAPElement
Parameters:
element -
Returns:
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addChildElement(javax.xml.soap.SOAPElement)

addTextNode

public javax.xml.soap.SOAPElement addTextNode(java.lang.String text)
                                       throws javax.xml.soap.SOAPException
Method addTextNode

Specified by:
addTextNode in interface javax.xml.soap.SOAPElement
Parameters:
text -
Returns:
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addTextNode(java.lang.String)

addAttribute

public javax.xml.soap.SOAPElement addAttribute(javax.xml.soap.Name name,
                                               java.lang.String value)
                                        throws javax.xml.soap.SOAPException
Method addAttribute This method adds an attribute to the underlying omElement datamember and returns ourselves

Specified by:
addAttribute in interface javax.xml.soap.SOAPElement
Parameters:
name -
value -
Returns:
ourself
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addAttribute(javax.xml.soap.Name, java.lang.String)

addNamespaceDeclaration

public javax.xml.soap.SOAPElement addNamespaceDeclaration(java.lang.String prefix,
                                                          java.lang.String uri)
                                                   throws javax.xml.soap.SOAPException
Method addNamespaceDeclaration

Specified by:
addNamespaceDeclaration in interface javax.xml.soap.SOAPElement
Parameters:
prefix -
uri -
Returns:
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.addNamespaceDeclaration(java.lang.String, java.lang.String)

getAttributeValue

public java.lang.String getAttributeValue(javax.xml.soap.Name name)
Method getAttributeValue

Specified by:
getAttributeValue in interface javax.xml.soap.SOAPElement
Parameters:
name -
Returns:
See Also:
SOAPElement.getAttributeValue(javax.xml.soap.Name)

getAllAttributes

public java.util.Iterator getAllAttributes()
Method getAllAttributes

Specified by:
getAllAttributes in interface javax.xml.soap.SOAPElement
Returns:
See Also:
SOAPElement.getAllAttributes()

getNamespaceURI

public java.lang.String getNamespaceURI(java.lang.String prefix)
Method getNamespaceURI

Specified by:
getNamespaceURI in interface javax.xml.soap.SOAPElement
Parameters:
prefix -
Returns:
See Also:
SOAPElement.getNamespaceURI(java.lang.String)

getNamespacePrefixes

public java.util.Iterator getNamespacePrefixes()
method getNamespacePrefixes This method returns an iterator over all the declared namespaces prefix names.

Specified by:
getNamespacePrefixes in interface javax.xml.soap.SOAPElement
Returns:
Iterator
See Also:
SOAPElement.getNamespacePrefixes()

getElementName

public javax.xml.soap.Name getElementName()
Method getElementName

Specified by:
getElementName in interface javax.xml.soap.SOAPElement
Returns:
See Also:
SOAPElement.getElementName()

removeAttribute

public boolean removeAttribute(javax.xml.soap.Name name)
method removeAttribute This method removes an attribute with the specified name from the element. Returns true if the attribute was removed successfully; false if it was not

Specified by:
removeAttribute in interface javax.xml.soap.SOAPElement
Parameters:
name -
Returns:
boolean
See Also:
SOAPElement.removeAttribute(javax.xml.soap.Name)

removeNamespaceDeclaration

public boolean removeNamespaceDeclaration(java.lang.String prefix)
method removeNamespaceDeclaration

Specified by:
removeNamespaceDeclaration in interface javax.xml.soap.SOAPElement
Parameters:
prefix -
Returns:
See Also:
SOAPElement.removeNamespaceDeclaration(java.lang.String)

getChildElements

public java.util.Iterator getChildElements()
method getChildElements

Specified by:
getChildElements in interface javax.xml.soap.SOAPElement
Returns:
See Also:
SOAPElement.getChildElements()

getChildElements

public java.util.Iterator getChildElements(javax.xml.soap.Name name)
method getChildElements

Specified by:
getChildElements in interface javax.xml.soap.SOAPElement
Parameters:
name -
Returns:
See Also:
SOAPElement.getChildElements(javax.xml.soap.Name)

setEncodingStyle

public void setEncodingStyle(java.lang.String encodingStyle)
                      throws javax.xml.soap.SOAPException
method setEncodingStyle

Specified by:
setEncodingStyle in interface javax.xml.soap.SOAPElement
Parameters:
encodingStyle -
Throws:
javax.xml.soap.SOAPException
See Also:
SOAPElement.setEncodingStyle(java.lang.String)

getEncodingStyle

public java.lang.String getEncodingStyle()
method getEncodingStyle

Specified by:
getEncodingStyle in interface javax.xml.soap.SOAPElement
Returns:
See Also:
SOAPElement.getEncodingStyle()

removeContents

public void removeContents()
method removeContents

Specified by:
removeContents in interface javax.xml.soap.SOAPElement
See Also:
SOAPElement.removeContents()

getVisibleNamespacePrefixes

public java.util.Iterator getVisibleNamespacePrefixes()
method getVisibleNamespacePrefixes

Specified by:
getVisibleNamespacePrefixes in interface javax.xml.soap.SOAPElement
Returns:
See Also:
SOAPElement.getVisibleNamespacePrefixes()

getTagName

public java.lang.String getTagName()
method getTagName

Specified by:
getTagName in interface org.w3c.dom.Element
Returns:
See Also:
Element.getTagName()

removeAttribute

public void removeAttribute(java.lang.String localName)
                     throws org.w3c.dom.DOMException
method removeAttribute

Specified by:
removeAttribute in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException
See Also:
Element.removeAttribute(java.lang.String)

hasAttribute

public boolean hasAttribute(java.lang.String localName)
method hasAttribute This method returns true when an attribute with a given name is specified on this element, false otherwise.

Specified by:
hasAttribute in interface org.w3c.dom.Element
Parameters:
localName -
Returns:
See Also:
Element.hasAttribute(java.lang.String)

getAttribute

public java.lang.String getAttribute(java.lang.String name)
method getAttribute This method retrieves the value of an attribute having specified localname. In case of an element having multiple attributes with same localname but declared in different namespaces, use of this method is unadvised.

Specified by:
getAttribute in interface org.w3c.dom.Element
Parameters:
name -
Returns:
String
See Also:
Element.getAttribute(java.lang.String)

removeAttributeNS

public void removeAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
                       throws org.w3c.dom.DOMException
Specified by:
removeAttributeNS in interface org.w3c.dom.Element
Throws:
org.w3c.dom.DOMException

setAttribute

public void setAttribute(java.lang.String localName,
                         java.lang.String value)
                  throws org.w3c.dom.DOMException
Method setAttribute This method creates and adds an attribute with the given localName and value into the underlying OM. It uses the namespace of omElement datamember of this SOAPElement for the newly added attribute.

Specified by:
setAttribute in interface org.w3c.dom.Element
Parameters:
localName -
value -
Returns:
Throws:
org.w3c.dom.DOMException
See Also:
Element.setAttribute(java.lang.String, java.lang.String)

hasAttributeNS

public boolean hasAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
method hasAttributeNS This method returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.

Specified by:
hasAttributeNS in interface org.w3c.dom.Element
Parameters:
namespaceURI -
localName -
Returns:
boolean
See Also:
Element.hasAttributeNS(java.lang.String, java.lang.String)

getAttributeNode

public org.w3c.dom.Attr getAttributeNode(java.lang.String localName)
method getAttributeNode This method retrieves an attribute node by the specified localname

Specified by:
getAttributeNode in interface org.w3c.dom.Element
See Also:
Element.getAttributeNode(java.lang.String)

removeAttributeNode

public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
                                     throws org.w3c.dom.DOMException
method removeAttributeNode This method removes the specified attribute node from this element.

Specified by:
removeAttributeNode in interface org.w3c.dom.Element
Returns:
Attr The removed attribute node
Throws:
org.w3c.dom.DOMException
See Also:
Element.removeAttributeNode(org.w3c.dom.Attr)

setAttributeNode

public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr attr)
                                  throws org.w3c.dom.DOMException
Method setAttributeNode This method creates and adds an attribute corresponding to the supplied Attr object into the underlying OM. The attribute that gets added to OM is created against this.omElement's namespace

Specified by:
setAttributeNode in interface org.w3c.dom.Element
Parameters:
attr - - a dom Attr object
Returns:
Attr - a dom Attr object corresponding to the added attribute.
Throws:
org.w3c.dom.DOMException
See Also:
Element.setAttributeNode(org.w3c.dom.Attr)

setAttributeNodeNS

public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr attr)
                                    throws org.w3c.dom.DOMException
Method setAttributeNode This method creates and adds an attribute corresponding to the supplied Attr object into the underlying OM. The attribute added is created against it's own namespace

Specified by:
setAttributeNodeNS in interface org.w3c.dom.Element
Parameters:
attr - - a dom Attr object
Returns:
Attr - a dom Attr object corresponding to the added attribute.
Throws:
org.w3c.dom.DOMException
See Also:
Element.setAttributeNodeNS(org.w3c.dom.Attr)

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String localName)
Method getElementsByTagName Returns a NodeList of all the descendant Elements with the given local name, in the order in which they are encountered in a preorder traversal of this Element tree. Current SOAPElement MAY not feature in the returned NodeList, only the descendant elements matching the criterion should be added.

Specified by:
getElementsByTagName in interface org.w3c.dom.Element
Parameters:
localName -
Returns:
NodeList
See Also:
Element.getElementsByTagName(java.lang.String)

getAttributeNS

public java.lang.String getAttributeNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
method getAttributeNS This method retrieves the value of the attribute matching the specified namespaceURI, and localName

Specified by:
getAttributeNS in interface org.w3c.dom.Element
Parameters:
namespaceURI -
localName -
Returns:
String
See Also:
Element.getAttributeNS(java.lang.String, java.lang.String)

setAttributeNS

public void setAttributeNS(java.lang.String namespaceURI,
                           java.lang.String localName,
                           java.lang.String value)
                    throws org.w3c.dom.DOMException
Method setAttributeNS This method creates and adds an attribute with the given namespaceURI, localName and value into the underlying OM.

Specified by:
setAttributeNS in interface org.w3c.dom.Element
Parameters:
localName -
value -
Returns:
Throws:
org.w3c.dom.DOMException
See Also:
Element.setAttributeNS(java.lang.String, java.lang.String, java.lang.String)

getAttributeNodeNS

public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
                                           java.lang.String localName)
method getAttributeNodeNS This method retrieves an org.w3c.dom.Attr node matching the specified namespaceURI and localName

Specified by:
getAttributeNodeNS in interface org.w3c.dom.Element
Parameters:
namespaceURI -
localName -
Returns:
Attr
See Also:
Element.getAttributeNodeNS(java.lang.String, java.lang.String)

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                   java.lang.String localName)
getElementsByTagNameNS Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree. Current SOAPElement MAY not feature in the returned NodeList, only the descendant elements matching the criterion should be added.

Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Element
Parameters:
namespaceURI -
localName -
Returns:
NodeList
See Also:
Element.getElementsByTagNameNS(java.lang.String, java.lang.String)