java.lang.Object
jakarta.xml.soap.SOAPPart
com.sun.xml.messaging.saaj.soap.SOAPPartImpl
- All Implemented Interfaces:
SOAPDocument,Node,Document,Node
- Direct Known Subclasses:
SOAPPart1_1Impl,SOAPPart1_2Impl
SOAPPartImpl is the first attachment. This contains the XML/SOAP document.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SOAPDocumentImplprotected Envelopeprotected MimeHeadersprotected MessageImplReference to containing message (may be null)protected booleanprotected Sourceprotected StringFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMimeHeader(String name, String value) Creates aMimeHeaderobject with the specified name and value and adds it to thisSOAPPartobject.appendChild(Node newChild) cloneNode(boolean deep) shortcompareDocumentPosition(Node other) createAttribute(String name) createAttributeNS(String namespaceURI, String qualifiedName) createCDATASection(String data) createComment(String data) createElement(String tagName) createElementNS(String namespaceURI, String qualifiedName) protected abstract EnvelopecreateEmptyEnvelope(String prefix) createEntityReference(String name) protected abstract EnvelopecreateProcessingInstruction(String target, String data) createTextNode(String data) voidRemoves thisNodeobject from the tree.protected SOAPPartImplprotected voidprotected abstract SOAPPartImplRetrieves all the headers for thisSOAPPartobject as an iterator over theMimeHeaderobjects.Returns the content of the SOAPEnvelope as a JAXPSourceobject.protected abstract Stringprotected StringgetElementById(String elementId) getElementsByTagName(String tagname) getElementsByTagNameNS(String namespaceURI, String localName) Gets theSOAPEnvelopeobject associated with thisSOAPPartobject.getFeature(String feature, String version) getMatchingMimeHeaders(String[] names) Retrieves allMimeHeaderobjects that match a name in the given array.String[]getMimeHeader(String name) Gets all the values of theMimeHeaderobject in thisSOAPPartobject that is identified by the givenString.shortgetNonMatchingMimeHeaders(String[] names) Retrieves allMimeHeaderobjects whose name does not match a name in the given array.Returns the parent element of thisNodeobject.abstract StringbooleangetUserData(String key) getValue()Returns the value of this node if this is aTextnode or the value of the immediate child of this node otherwise.booleanbooleanbooleanimportNode(Node importedNode, boolean deep) insertBefore(Node arg0, Node arg1) booleanisDefaultNamespace(String namespaceURI) booleanisEqualNode(Node arg) booleanbooleanisSameNode(Node other) booleanisSupported(String arg0, String arg1) protected voidprotected XMLDeclarationParserlookupNamespaceURI(String prefix) lookupPrefix(String namespaceURI) voidvoidvoidNotifies 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.voidRemoves all theMimeHeaderobjects for thisSOAPEnvelopeobject.removeChild(Node arg0) voidremoveMimeHeader(String header) Removes all MIME headers that match the given name.renameNode(Node n, String namespaceURI, String qualifiedName) replaceChild(Node arg0, Node arg1) voidsetContent(Source source) Sets the content of theSOAPEnvelopeobject with the data from the givenSourceobject.voidsetDocumentURI(String documentURI) voidsetMimeHeader(String name, 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.voidsetNodeValue(String arg0) voidsetParentElement(SOAPElement parent) Sets the parent of thisNodeobject to the givenSOAPElementobject.voidvoidsetSourceCharsetEncoding(String charset) voidsetStrictErrorChecking(boolean strictErrorChecking) voidsetTextContent(String textContent) setUserData(String key, Object data, UserDataHandler handler) voidIf 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.voidsetXmlStandalone(boolean xmlStandalone) voidsetXmlVersion(String xmlVersion) Methods inherited from class jakarta.xml.soap.SOAPPart
getContentId, getContentLocation, setContentId, setContentLocation
-
Field Details
-
headers
-
envelope
-
source
-
document
-
omitXmlDecl
protected boolean omitXmlDecl -
sourceCharsetEncoding
-
message
Reference to containing message (may be null)
-
-
Constructor Details
-
SOAPPartImpl
protected SOAPPartImpl() -
SOAPPartImpl
-
-
Method Details
-
getContentType
-
createEnvelopeFromSource
- Throws:
SOAPException
-
createEmptyEnvelope
- Throws:
SOAPException
-
duplicateType
-
getContentTypeString
-
isFastInfoset
public boolean isFastInfoset() -
getEnvelope
Description copied from class:SOAPPartGets theSOAPEnvelopeobject associated with thisSOAPPartobject. Once the SOAP envelope is obtained, it can be used to get its contents.- Specified by:
getEnvelopein classSOAPPart- Returns:
- the
SOAPEnvelopeobject for thisSOAPPartobject - Throws:
SOAPException- if there is a SOAP error
-
lookForEnvelope
- Throws:
SOAPException
-
removeAllMimeHeaders
public void removeAllMimeHeaders()Description copied from class:SOAPPartRemoves all theMimeHeaderobjects for thisSOAPEnvelopeobject.- Specified by:
removeAllMimeHeadersin classSOAPPart
-
removeMimeHeader
Description copied from class:SOAPPartRemoves all MIME headers that match the given name.- Specified by:
removeMimeHeaderin classSOAPPart- Parameters:
header- aStringgiving the name of the MIME header(s) to be removed
-
getMimeHeader
Description copied from class:SOAPPartGets all the values of theMimeHeaderobject in thisSOAPPartobject that is identified by the givenString.- Specified by:
getMimeHeaderin classSOAPPart- Parameters:
name- the name of the header; example: "Content-Type"- Returns:
- a
Stringarray giving all the values for the specified header - See Also:
-
setMimeHeader
Description copied from class:SOAPPartChanges 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 the matching headers after the first one.Note that RFC822 headers can contain only US-ASCII characters.
- Specified by:
setMimeHeaderin classSOAPPart- Parameters:
name- aStringgiving the header name for which to searchvalue- aStringgiving 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 newMimeHeaderobject.- See Also:
-
addMimeHeader
Description copied from class:SOAPPartCreates aMimeHeaderobject with the specified name and value and adds it to thisSOAPPartobject. If aMimeHeaderwith the specified name already exists, this method adds the specified value to the already existing value(s).Note that RFC822 headers can contain only US-ASCII characters.
- Specified by:
addMimeHeaderin classSOAPPart- Parameters:
name- aStringgiving the header namevalue- aStringgiving the value to be set or added
-
getAllMimeHeaders
Description copied from class:SOAPPartRetrieves all the headers for thisSOAPPartobject as an iterator over theMimeHeaderobjects.- Specified by:
getAllMimeHeadersin classSOAPPart- Returns:
- an
Iteratorobject with all the Mime headers for thisSOAPPartobject
-
getMatchingMimeHeaders
Description copied from class:SOAPPartRetrieves allMimeHeaderobjects that match a name in the given array.- Specified by:
getMatchingMimeHeadersin classSOAPPart- Parameters:
names- aStringarray with the name(s) of the MIME headers to be returned- Returns:
- all the MIME headers that match one of the names in the
given array, returned as an
Iteratorobject
-
getNonMatchingMimeHeaders
Description copied from class:SOAPPartRetrieves allMimeHeaderobjects whose name does not match a name in the given array.- Specified by:
getNonMatchingMimeHeadersin classSOAPPart- Parameters:
names- aStringarray with the name(s) of the MIME headers not to be returned- Returns:
- all the MIME headers in this
SOAPPartobject except those that match one of the names in the given array. The non-matching MIME headers are returned as anIteratorobject.
-
getContent
Description copied from class:SOAPPartReturns the content of the SOAPEnvelope as a JAXPSourceobject.- Specified by:
getContentin classSOAPPart- Returns:
- the content as a
javax.xml.transform.Sourceobject - Throws:
SOAPException- if the implementation cannot convert the specifiedSourceobject- See Also:
-
setContent
Description copied from class:SOAPPartSets the content of theSOAPEnvelopeobject with the data from the givenSourceobject. ThisSourcemust contain a valid SOAP document.- Specified by:
setContentin classSOAPPart- Parameters:
source- thejavax.xml.transform.Sourceobject with the data to be set- Throws:
SOAPException- if there is a problem in setting the source- See Also:
-
getContentAsStream
- Throws:
IOException
-
getDocument
- Specified by:
getDocumentin interfaceSOAPDocument
-
getSOAPPart
- Specified by:
getSOAPPartin interfaceSOAPDocument
-
getDoctype
- Specified by:
getDoctypein interfaceDocument
-
getImplementation
- Specified by:
getImplementationin interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElementin interfaceDocument
-
doGetDocumentElement
protected void doGetDocumentElement() -
createElement
- Specified by:
createElementin interfaceDocument- Throws:
DOMException
-
createDocumentFragment
- Specified by:
createDocumentFragmentin interfaceDocument
-
createTextNode
- Specified by:
createTextNodein interfaceDocument
-
createComment
- Specified by:
createCommentin interfaceDocument
-
createCDATASection
- Specified by:
createCDATASectionin interfaceDocument- Throws:
DOMException
-
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException - Specified by:
createProcessingInstructionin interfaceDocument- Throws:
DOMException
-
createAttribute
- Specified by:
createAttributein interfaceDocument- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument- Throws:
DOMException
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceDocument
-
importNode
- Specified by:
importNodein interfaceDocument- Throws:
DOMException
-
createElementNS
- Specified by:
createElementNSin interfaceDocument- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNSin interfaceDocument- Throws:
DOMException
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceDocument
-
getElementById
- Specified by:
getElementByIdin interfaceDocument
-
appendChild
- Specified by:
appendChildin interfaceNode- Throws:
DOMException
-
cloneNode
-
doCloneNode
-
getAttributes
- Specified by:
getAttributesin interfaceNode
-
getChildNodes
- Specified by:
getChildNodesin interfaceNode
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode
-
getLastChild
- Specified by:
getLastChildin interfaceNode
-
getLocalName
- Specified by:
getLocalNamein interfaceNode
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNode
-
getNextSibling
- Specified by:
getNextSiblingin interfaceNode
-
getNodeName
- Specified by:
getNodeNamein interfaceNode
-
getNodeType
public short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
getNodeValue
- Specified by:
getNodeValuein interfaceNode- Throws:
DOMException
-
getOwnerDocument
- Specified by:
getOwnerDocumentin interfaceNode
-
getParentNode
- Specified by:
getParentNodein interfaceNode
-
getPrefix
-
getPreviousSibling
- Specified by:
getPreviousSiblingin interfaceNode
-
hasAttributes
public boolean hasAttributes()- Specified by:
hasAttributesin interfaceNode
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodesin interfaceNode
-
insertBefore
- Specified by:
insertBeforein interfaceNode- Throws:
DOMException
-
isSupported
- Specified by:
isSupportedin interfaceNode
-
normalize
public void normalize() -
removeChild
- Specified by:
removeChildin interfaceNode- Throws:
DOMException
-
replaceChild
- Specified by:
replaceChildin interfaceNode- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValuein interfaceNode- Throws:
DOMException
-
setPrefix
- Specified by:
setPrefixin interfaceNode- Throws:
DOMException
-
lookForXmlDecl
- Throws:
SOAPException
-
setSourceCharsetEncoding
-
renameNode
- Specified by:
renameNodein interfaceDocument- Throws:
DOMException
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocumentin interfaceDocument
-
getDomConfig
- Specified by:
getDomConfigin interfaceDocument
-
adoptNode
- Specified by:
adoptNodein interfaceDocument- Throws:
DOMException
-
setDocumentURI
- Specified by:
setDocumentURIin interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURIin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorCheckingin interfaceDocument
-
getInputEncoding
- Specified by:
getInputEncodingin interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalonein interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalonein interfaceDocument- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersionin interfaceDocument- Throws:
DOMException
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorCheckingin interfaceDocument
-
getBaseURI
- Specified by:
getBaseURIin interfaceNode
-
compareDocumentPosition
- Specified by:
compareDocumentPositionin interfaceNode- Throws:
DOMException
-
getTextContent
- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
setTextContent
- Specified by:
setTextContentin interfaceNode- Throws:
DOMException
-
isSameNode
- Specified by:
isSameNodein interfaceNode
-
lookupPrefix
- Specified by:
lookupPrefixin interfaceNode
-
isDefaultNamespace
- Specified by:
isDefaultNamespacein interfaceNode
-
lookupNamespaceURI
- Specified by:
lookupNamespaceURIin interfaceNode
-
isEqualNode
- Specified by:
isEqualNodein interfaceNode
-
getFeature
- Specified by:
getFeaturein interfaceNode
-
setUserData
- Specified by:
setUserDatain interfaceNode
-
getUserData
- Specified by:
getUserDatain interfaceNode
-
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
-
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
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. -
setParentElement
Description copied from interface:NodeSets the parent of thisNodeobject to the givenSOAPElementobject.- Specified by:
setParentElementin interfaceNode- Parameters:
parent- 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:
-
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:
-
detachNode
public void detachNode()Description copied from interface:NodeRemoves thisNodeobject from the tree.- Specified by:
detachNodein interfaceNode
-
getSourceCharsetEncoding
-
getSOAPNamespace
-