org.apache.axis2.saaj
Class SOAPElementImpl

java.lang.Object
  extended byorg.apache.axis2.om.impl.dom.NodeImpl
      extended byorg.apache.axis2.saaj.NodeImplEx
          extended byorg.apache.axis2.saaj.SOAPElementImpl
All Implemented Interfaces:
Cloneable, Element, Node, Node, NodeList, OMNode, OMNodeEx, SOAPElement
Direct Known Subclasses:
DetailEntryImpl, SOAPBodyElementImpl, SOAPBodyImpl, SOAPEnvelopeImpl, SOAPFaultElementImpl, SOAPHeaderElementImpl, SOAPHeaderImpl

public class SOAPElementImpl
extends NodeImplEx
implements SOAPElement


Field Summary
protected  ElementImpl element
          Using a delegate because we can't extend from org.apache.axis2.om.impl.dom.ElementImpl since this class must extend SNodeImpl
 
Fields inherited from class org.apache.axis2.om.impl.dom.NodeImpl
builder, done, FIRSTCHILD, flags, nodeType, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED
 
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
 
Fields inherited from interface org.apache.axis2.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Constructor Summary
SOAPElementImpl(ElementImpl element)
           
 
Method Summary
 SOAPElement addAttribute(Name name, String value)
          Adds an attribute with the specified name and value to this SOAPElement object.
 SOAPElement addChildElement(Name name)
           
 SOAPElement addChildElement(SOAPElement soapElement)
           
 SOAPElement addChildElement(String localName)
           
 SOAPElement addChildElement(String localName, String prefix)
           
 SOAPElement addChildElement(String localName, String prefix, String uri)
           
 SOAPElement addNamespaceDeclaration(String prefix, String uri)
           
 SOAPElement addTextNode(String text)
          Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
 void discard()
          Discards a node.
 Iterator getAllAttributes()
          Returns an iterator over all of the attribute names in this SOAPElement object.
 String getAttribute(String name)
           
 Attr getAttributeNode(String name)
           
 Attr getAttributeNodeNS(String namespaceURI, String localName)
           
 String getAttributeNS(String namespaceURI, String localName)
           
 String getAttributeValue(Name name)
           
 Iterator getChildElements()
          Returns an iterator over all the immediate content of this element.
 Iterator getChildElements(Name name)
           
 NodeList getChildNodes()
           
 ElementImpl getElement()
           
 Name getElementName()
           
 NodeList getElementsByTagName(String name)
           
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
           
 String getEncodingStyle()
           
 Node getFirstChild()
          Gets the first child of this Node, or null if none.
 Node getLastChild()
          Method getLastChild
 Iterator getNamespacePrefixes()
           
 String getNamespaceURI(String prefix)
           
 Node getNextSibling()
          dom Node method
 String getNodeName()
           
 short getNodeType()
           
 Document getOwnerDocument()
          Find the Document that this Node belongs to (the document in whose context the Node was created).
 SOAPElement getParentElement()
          Returns the parent element of this Node object.
 Node getPreviousSibling()
          Returns the previous child of this node's parent, or null if none.
 String getTagName()
           
 String getValue()
          Returns the the value of the immediate child of this Node object if a child exists and its value is text.
 Iterator getVisibleNamespacePrefixes()
           
 boolean hasAttribute(String name)
           
 boolean hasAttributeNS(String namespaceURI, String localName)
           
 boolean hasChildNodes()
           
 boolean removeAttribute(Name name)
           
 void removeAttribute(String name)
           
 Attr removeAttributeNode(Attr attr)
           
 void removeAttributeNS(String namespaceURI, String localName)
           
 void removeContents()
           
 boolean removeNamespaceDeclaration(String prefix)
           
 void serialize(OMOutputImpl omOutput)
          Serializes the node with caching.
 void serializeAndConsume(OMOutputImpl omOutput)
          Serializes the node without caching.
 void setAttribute(String name, String value)
           
 Attr setAttributeNode(Attr attr)
           
 Attr setAttributeNodeNS(Attr attr)
           
 void setAttributeNS(String namespaceURI, String qualifiedName, String value)
           
 void setEncodingStyle(String encodingStyle)
           
 void setParent(OMContainer parentElement)
           
 
Methods inherited from class org.apache.axis2.saaj.NodeImplEx
detachNode, getParent, getType, recycleNode, setParentElement, setType, setValue
 
Methods inherited from class org.apache.axis2.om.impl.dom.NodeImpl
appendChild, build, cloneNode, compareDocumentPosition, detach, getAttributes, getBaseURI, getFeature, getLength, getLocalName, getNamespaceURI, getNextOMSibling, getNodeValue, getParentNode, getPrefix, getPreviousOMSibling, getTextContent, getUserData, hasAttributes, insertBefore, insertSiblingAfter, insertSiblingBefore, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeWithCache, setComplete, setNextOMSibling, setNodeValue, setOwnerDocument, setPrefix, setPreviousOMSibling, setTextContent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.xml.soap.Node
detachNode, recycleNode, setParentElement, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getLocalName, getNamespaceURI, getNodeValue, getParentNode, getPrefix, hasAttributes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Field Detail

element

protected ElementImpl element
Using a delegate because we can't extend from org.apache.axis2.om.impl.dom.ElementImpl since this class must extend SNodeImpl

Constructor Detail

SOAPElementImpl

public SOAPElementImpl(ElementImpl element)
Method Detail

discard

public void discard()
             throws OMException
Description copied from interface: OMNode
Discards a node.

Discard goes to the parser level and if the element is not completely built, then it will be completely skipped at the parser level.

Specified by:
discard in interface OMNode
Throws:
OMException

serialize

public void serialize(OMOutputImpl omOutput)
               throws XMLStreamException
Description copied from interface: OMNodeEx
Serializes the node with caching.

Specified by:
serialize in interface OMNodeEx
Parameters:
omOutput -
Throws:
XMLStreamException
See Also:
OMNodeEx.serialize(org.apache.axis2.om.impl.OMOutputImpl)

serializeAndConsume

public void serializeAndConsume(OMOutputImpl omOutput)
                         throws XMLStreamException
Description copied from interface: OMNodeEx
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNodeEx
Parameters:
omOutput -
Throws:
XMLStreamException

addAttribute

public SOAPElement addAttribute(Name name,
                                String value)
                         throws SOAPException
Adds an attribute with the specified name and value to this SOAPElement object.

Specified by:
addAttribute in interface SOAPElement
Parameters:
name - a Name object with the name of the attribute
value - a String giving the value of the attribute
Returns:
the SOAPElement object into which the attribute was inserted
Throws:
SOAPException - if there is an error in creating the Attribute

addChildElement

public SOAPElement addChildElement(Name name)
                            throws SOAPException
Specified by:
addChildElement in interface SOAPElement
Throws:
SOAPException

addChildElement

public SOAPElement addChildElement(SOAPElement soapElement)
                            throws SOAPException
Specified by:
addChildElement in interface SOAPElement
Throws:
SOAPException

addChildElement

public SOAPElement addChildElement(String localName,
                                   String prefix,
                                   String uri)
                            throws SOAPException
Specified by:
addChildElement in interface SOAPElement
Throws:
SOAPException

addChildElement

public SOAPElement addChildElement(String localName,
                                   String prefix)
                            throws SOAPException
Specified by:
addChildElement in interface SOAPElement
Throws:
SOAPException

addChildElement

public SOAPElement addChildElement(String localName)
                            throws SOAPException
Specified by:
addChildElement in interface SOAPElement
Throws:
SOAPException

addNamespaceDeclaration

public SOAPElement addNamespaceDeclaration(String prefix,
                                           String uri)
                                    throws SOAPException
Specified by:
addNamespaceDeclaration in interface SOAPElement
Throws:
SOAPException

addTextNode

public SOAPElement addTextNode(String text)
                        throws SOAPException
Creates a new Text object initialized with the given String and adds it to this SOAPElement object.

Specified by:
addTextNode in interface SOAPElement
Parameters:
text - a String object with the textual content to be added
Returns:
the SOAPElement object into which the new Text object was inserted
Throws:
SOAPException - if there is an error in creating the new Text object

getAllAttributes

public Iterator getAllAttributes()
Returns an iterator over all of the attribute names in this SOAPElement object. The iterator can be used to get the attribute names, which can then be passed to the method getAttributeValue to retrieve the value of each attribute.

Specified by:
getAllAttributes in interface SOAPElement
Returns:
an iterator over the names of the attributes

getAttributeValue

public String getAttributeValue(Name name)
Specified by:
getAttributeValue in interface SOAPElement

getChildElements

public Iterator getChildElements()
Returns an iterator over all the immediate content of this element. This includes Text objects as well as SOAPElement objects.

Specified by:
getChildElements in interface SOAPElement
Returns:
an iterator over Text and SOAPElement contained within this SOAPElement object

getChildElements

public Iterator getChildElements(Name name)
Specified by:
getChildElements in interface SOAPElement

getElementName

public Name getElementName()
Specified by:
getElementName in interface SOAPElement

getEncodingStyle

public String getEncodingStyle()
Specified by:
getEncodingStyle in interface SOAPElement

getNamespacePrefixes

public Iterator getNamespacePrefixes()
Specified by:
getNamespacePrefixes in interface SOAPElement

getNamespaceURI

public String getNamespaceURI(String prefix)
Specified by:
getNamespaceURI in interface SOAPElement

getVisibleNamespacePrefixes

public Iterator getVisibleNamespacePrefixes()
Specified by:
getVisibleNamespacePrefixes in interface SOAPElement

removeAttribute

public boolean removeAttribute(Name name)
Specified by:
removeAttribute in interface SOAPElement

removeContents

public void removeContents()
Specified by:
removeContents in interface SOAPElement

removeNamespaceDeclaration

public boolean removeNamespaceDeclaration(String prefix)
Specified by:
removeNamespaceDeclaration in interface SOAPElement

setEncodingStyle

public void setEncodingStyle(String encodingStyle)
                      throws SOAPException
Specified by:
setEncodingStyle in interface SOAPElement
Throws:
SOAPException

setParent

public void setParent(OMContainer parentElement)
Specified by:
setParent in interface OMNodeEx

getAttribute

public String getAttribute(String name)
Specified by:
getAttribute in interface Element

getAttributeNode

public Attr getAttributeNode(String name)
Specified by:
getAttributeNode in interface Element

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI,
                               String localName)
Specified by:
getAttributeNodeNS in interface Element

getAttributeNS

public String getAttributeNS(String namespaceURI,
                             String localName)
Specified by:
getAttributeNS in interface Element

getElementsByTagName

public NodeList getElementsByTagName(String name)
Specified by:
getElementsByTagName in interface Element

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI,
                                       String localName)
Specified by:
getElementsByTagNameNS in interface Element

getTagName

public String getTagName()
Specified by:
getTagName in interface Element

hasAttribute

public boolean hasAttribute(String name)
Specified by:
hasAttribute in interface Element

hasAttributeNS

public boolean hasAttributeNS(String namespaceURI,
                              String localName)
Specified by:
hasAttributeNS in interface Element

removeAttribute

public void removeAttribute(String name)
                     throws DOMException
Specified by:
removeAttribute in interface Element
Throws:
DOMException

removeAttributeNode

public Attr removeAttributeNode(Attr attr)
                         throws DOMException
Specified by:
removeAttributeNode in interface Element
Throws:
DOMException

removeAttributeNS

public void removeAttributeNS(String namespaceURI,
                              String localName)
                       throws DOMException
Specified by:
removeAttributeNS in interface Element
Throws:
DOMException

setAttribute

public void setAttribute(String name,
                         String value)
                  throws DOMException
Specified by:
setAttribute in interface Element
Throws:
DOMException

setAttributeNode

public Attr setAttributeNode(Attr attr)
                      throws DOMException
Specified by:
setAttributeNode in interface Element
Throws:
DOMException

setAttributeNodeNS

public Attr setAttributeNodeNS(Attr attr)
                        throws DOMException
Specified by:
setAttributeNodeNS in interface Element
Throws:
DOMException

setAttributeNS

public void setAttributeNS(String namespaceURI,
                           String qualifiedName,
                           String value)
                    throws DOMException
Specified by:
setAttributeNS in interface Element
Throws:
DOMException

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface Node

getElement

public ElementImpl getElement()

getParentElement

public SOAPElement getParentElement()
Returns the parent element of this Node object. This method can throw an UnsupportedOperationException if the tree is not kept in memory.

Specified by:
getParentElement in interface Node
Overrides:
getParentElement in class NodeImplEx
Returns:
the SOAPElement object that is the parent of this Node object or null if this Node object is root
Throws:
UnsupportedOperationException - if the whole tree is not kept in memory
See Also:
setParentElement(javax.xml.soap.SOAPElement)

getOwnerDocument

public Document getOwnerDocument()
Find the Document that this Node belongs to (the document in whose context the Node was created). The Node may or may not

Specified by:
getOwnerDocument in interface Node
Overrides:
getOwnerDocument in class NodeImpl

getValue

public String getValue()
Returns the the value of the immediate child of this Node object if a child exists and its value is text.

Specified by:
getValue in interface Node
Overrides:
getValue in class NodeImplEx
Returns:
a String with the text of the immediate child of this Node object if (1) there is a child and (2) the child is a Text object; null otherwise

getFirstChild

public Node getFirstChild()
Description copied from class: NodeImpl
Gets the first child of this Node, or null if none.

By default we do not have any children, ParentNode overrides this.

Specified by:
getFirstChild in interface Node
Overrides:
getFirstChild in class NodeImpl
See Also:
ParentNode

getLastChild

public Node getLastChild()
Method getLastChild

Specified by:
getLastChild in interface Node
Overrides:
getLastChild in class NodeImpl
See Also:
Node.getLastChild()

getNextSibling

public Node getNextSibling()
dom Node method

Specified by:
getNextSibling in interface Node
Overrides:
getNextSibling in class NodeImpl

getPreviousSibling

public Node getPreviousSibling()
Description copied from class: NodeImpl
Returns the previous child of this node's parent, or null if none.

Specified by:
getPreviousSibling in interface Node
Overrides:
getPreviousSibling in class NodeImpl

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node
Overrides:
getChildNodes in class NodeImpl

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node
Overrides:
hasChildNodes in class NodeImpl