org.apache.axis2.saaj
Class SOAPPartImpl

java.lang.Object
  extended byjavax.xml.soap.SOAPPart
      extended byorg.apache.axis2.saaj.SOAPPartImpl
All Implemented Interfaces:
org.w3c.dom.Document, org.w3c.dom.Node

public class SOAPPartImpl
extends javax.xml.soap.SOAPPart


Field Summary
protected  org.w3c.dom.Document mDocument
          SOAPEnvelope is the Document Elements of this XML document
 
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
SOAPPartImpl(SOAPMessageImpl parent, java.lang.Object initialContents, boolean isBodyStream)
           
 
Method Summary
 void addMimeHeader(java.lang.String header, java.lang.String value)
          Add the specified MIME header, as per JAXM.
 org.w3c.dom.Node adoptNode(org.w3c.dom.Node node)
           
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
           
 org.w3c.dom.Node cloneNode(boolean deep)
           
 org.w3c.dom.Attr createAttribute(java.lang.String name)
           
 org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
           
 org.w3c.dom.Comment createComment(java.lang.String data)
           
 org.w3c.dom.DocumentFragment createDocumentFragment()
           
 org.w3c.dom.Element createElement(java.lang.String tagName)
           
 org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
           
 org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
           
 org.w3c.dom.Text createTextNode(java.lang.String data)
           
 java.util.Iterator getAllMimeHeaders()
          Retrieves all the headers for this SOAPPart object as an iterator over the MimeHeader objects.
 org.w3c.dom.NamedNodeMap getAttributes()
           
 org.w3c.dom.NodeList getChildNodes()
           
 javax.xml.transform.Source getContent()
          Returns the content of the SOAPEnvelope as a JAXP Source object.
 org.w3c.dom.DocumentType getDoctype()
           
 org.w3c.dom.Element getDocumentElement()
           
 org.w3c.dom.Element getElementById(java.lang.String elementId)
           
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
           
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
           
 java.lang.String getEncoding()
           
 javax.xml.soap.SOAPEnvelope getEnvelope()
          Gets the SOAPEnvelope object associated with this SOAPPart object.
 org.w3c.dom.Node getFirstChild()
           
 org.w3c.dom.DOMImplementation getImplementation()
           
 org.w3c.dom.Node getLastChild()
           
 java.lang.String getLocalName()
           
 java.util.Iterator getMatchingMimeHeaders(java.lang.String[] match)
          Get all headers that match.
 SOAPMessageImpl getMessage()
           
 java.lang.String[] getMimeHeader(java.lang.String name)
          Gets all the values of the MimeHeader object in this SOAPPart object that is identified by the given String.
 java.lang.String getNamespaceURI()
           
 org.w3c.dom.Node getNextSibling()
           
 java.lang.String getNodeName()
          Node Implementation
 short getNodeType()
           
 java.lang.String getNodeValue()
           
 java.util.Iterator getNonMatchingMimeHeaders(java.lang.String[] match)
          Get all headers that do not match.
 org.w3c.dom.Document getOwnerDocument()
           
 org.w3c.dom.Node getParentNode()
           
 java.lang.String getPrefix()
           
 org.w3c.dom.Node getPreviousSibling()
           
 org.w3c.dom.Document getSOAPDocument()
           
 boolean getStandalone()
           
 boolean getStrictErrorChecking()
           
 java.lang.String getVersion()
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep)
           
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
           
 boolean isSupported(java.lang.String feature, java.lang.String version)
           
 void normalize()
           
 void removeAllMimeHeaders()
          Removes all the MimeHeader objects for this SOAPEnvelope object.
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
           
 void removeMimeHeader(java.lang.String header)
          Removes all MIME headers that match the given name.
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
           
 void setContent(javax.xml.transform.Source source)
          Sets the content of the SOAPEnvelope object with the data from the given Source object.
 void setEncoding(java.lang.String s)
           
 void setMessage(SOAPMessageImpl msg)
          Set the Message for this Part.
 void setMimeHeader(java.lang.String name, java.lang.String value)
          Changes the first header entry that matches the given header name so that its value is the given value, adding a new header with the given name and value if no existing header is a match.
 void setNodeValue(java.lang.String nodeValue)
           
 void setPrefix(java.lang.String prefix)
           
 void setStandalone(boolean flag)
           
 void setStrictErrorChecking(boolean flag)
           
 void setVersion(java.lang.String s)
           
 
Methods inherited from class javax.xml.soap.SOAPPart
getContentId, getContentLocation, setContentId, setContentLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mDocument

protected org.w3c.dom.Document mDocument
SOAPEnvelope is the Document Elements of this XML document

Constructor Detail

SOAPPartImpl

public SOAPPartImpl(SOAPMessageImpl parent,
                    java.lang.Object initialContents,
                    boolean isBodyStream)
             throws javax.xml.soap.SOAPException
Method Detail

getMessage

public SOAPMessageImpl getMessage()

setMessage

public void setMessage(SOAPMessageImpl msg)
Set the Message for this Part. Do not call this Directly. Called by Message.

Parameters:
msg - the Message for this part

getEnvelope

public javax.xml.soap.SOAPEnvelope getEnvelope()
                                        throws javax.xml.soap.SOAPException
Description copied from class: javax.xml.soap.SOAPPart
Gets the SOAPEnvelope object associated with this SOAPPart object. Once the SOAP envelope is obtained, it can be used to get its contents.

Returns:
the SOAPEnvelope object for this SOAPPart object
Throws:
javax.xml.soap.SOAPException - if there is a SOAP error
See Also:
SOAPPart.getEnvelope()

removeMimeHeader

public void removeMimeHeader(java.lang.String header)
Removes all MIME headers that match the given name.

Parameters:
header - a String giving the name of the MIME header(s) to be removed

removeAllMimeHeaders

public void removeAllMimeHeaders()
Removes all the MimeHeader objects for this SOAPEnvelope object.


getMimeHeader

public java.lang.String[] getMimeHeader(java.lang.String name)
Gets all the values of the MimeHeader object in this SOAPPart object that is identified by the given String.

Parameters:
name - the name of the header; example: "Content-Type"
Returns:
a String array giving all the values for the specified header
See Also:
setMimeHeader(java.lang.String, java.lang.String)

setMimeHeader

public void setMimeHeader(java.lang.String name,
                          java.lang.String value)
Changes the first header entry that matches the given header name so that its value is the given value, adding a new header with the given name and value if no existing header is a match. If there is a match, this method clears all existing values for the first header that matches and sets the given value instead. If more than one header has the given name, this method removes all of the matching headers after the first one.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String giving the header name for which to search
value - a String giving the value to be set. This value will be substituted for the current value(s) of the first header that is a match if there is one. If there is no match, this value will be the value for a new MimeHeader object.
See Also:
getMimeHeader(java.lang.String)

addMimeHeader

public void addMimeHeader(java.lang.String header,
                          java.lang.String value)
Add the specified MIME header, as per JAXM.

Parameters:
header - the header to add
value - the value of that header

getAllMimeHeaders

public java.util.Iterator getAllMimeHeaders()
Retrieves all the headers for this SOAPPart object as an iterator over the MimeHeader objects.

Returns:
an Iterator object with all of the Mime headers for this SOAPPart object

getMatchingMimeHeaders

public java.util.Iterator getMatchingMimeHeaders(java.lang.String[] match)
Get all headers that match.

Parameters:
match - an array of Strings giving mime header names
Returns:
an Iterator over all values matching these headers

getNonMatchingMimeHeaders

public java.util.Iterator getNonMatchingMimeHeaders(java.lang.String[] match)
Get all headers that do not match.

Parameters:
match - an array of Strings giving mime header names
Returns:
an Iterator over all values not matching these headers

setContent

public void setContent(javax.xml.transform.Source source)
                throws javax.xml.soap.SOAPException
Description copied from class: javax.xml.soap.SOAPPart
Sets the content of the SOAPEnvelope object with the data from the given Source object.

Parameters:
source - javax.xml.transform.Source object with the data to be set
Throws:
javax.xml.soap.SOAPException - if there is a problem in setting the source
See Also:
getContent()

getContent

public javax.xml.transform.Source getContent()
                                      throws javax.xml.soap.SOAPException
Description copied from class: javax.xml.soap.SOAPPart
Returns the content of the SOAPEnvelope as a JAXP Source object.

Returns:
the content as a javax.xml.transform.Source object
Throws:
javax.xml.soap.SOAPException - if the implementation cannot convert the specified Source object
See Also:
setContent(javax.xml.transform.Source)

getSOAPDocument

public org.w3c.dom.Document getSOAPDocument()
Since:
SAAJ 1.2

getDoctype

public org.w3c.dom.DocumentType getDoctype()
Returns:

getImplementation

public org.w3c.dom.DOMImplementation getImplementation()
Returns:

getDocumentElement

public org.w3c.dom.Element getDocumentElement()

createElement

public org.w3c.dom.Element createElement(java.lang.String tagName)
                                  throws org.w3c.dom.DOMException
Parameters:
tagName -
Returns:
Throws:
org.w3c.dom.DOMException

createDocumentFragment

public org.w3c.dom.DocumentFragment createDocumentFragment()

createTextNode

public org.w3c.dom.Text createTextNode(java.lang.String data)

createComment

public org.w3c.dom.Comment createComment(java.lang.String data)

createCDATASection

public org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
                                            throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createProcessingInstruction

public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target,
                                                                     java.lang.String data)
                                                              throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createEntityReference

public org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
                                                  throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)

importNode

public org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode,
                                   boolean deep)
                            throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI,
                                           java.lang.String qualifiedName)
                                    throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI,
                                          java.lang.String qualifiedName)
                                   throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                   java.lang.String localName)

getElementById

public org.w3c.dom.Element getElementById(java.lang.String elementId)

getEncoding

public java.lang.String getEncoding()

setEncoding

public void setEncoding(java.lang.String s)

getStandalone

public boolean getStandalone()

setStandalone

public void setStandalone(boolean flag)

getStrictErrorChecking

public boolean getStrictErrorChecking()

setStrictErrorChecking

public void setStrictErrorChecking(boolean flag)

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String s)

adoptNode

public org.w3c.dom.Node adoptNode(org.w3c.dom.Node node)
                           throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getNodeName

public java.lang.String getNodeName()
Node Implementation


getNodeValue

public java.lang.String getNodeValue()
                              throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

setNodeValue

public void setNodeValue(java.lang.String nodeValue)
                  throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getNodeType

public short getNodeType()

getParentNode

public org.w3c.dom.Node getParentNode()

getChildNodes

public org.w3c.dom.NodeList getChildNodes()

getFirstChild

public org.w3c.dom.Node getFirstChild()

getLastChild

public org.w3c.dom.Node getLastChild()

getPreviousSibling

public org.w3c.dom.Node getPreviousSibling()

getNextSibling

public org.w3c.dom.Node getNextSibling()

getAttributes

public org.w3c.dom.NamedNodeMap getAttributes()

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()

insertBefore

public org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node refChild)
                              throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

replaceChild

public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node oldChild)
                              throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

removeChild

public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
                             throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
                             throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

hasChildNodes

public boolean hasChildNodes()

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)

normalize

public void normalize()

isSupported

public boolean isSupported(java.lang.String feature,
                           java.lang.String version)

getNamespaceURI

public java.lang.String getNamespaceURI()

getPrefix

public java.lang.String getPrefix()

setPrefix

public void setPrefix(java.lang.String prefix)
               throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getLocalName

public java.lang.String getLocalName()

hasAttributes

public boolean hasAttributes()