Package org.apache.axis2.saaj
Class SOAPBodyImpl
- java.lang.Object
-
- org.apache.axis2.saaj.ProxyNode<T,S>
-
- org.apache.axis2.saaj.NodeImpl<Element,T>
-
- org.apache.axis2.saaj.SOAPElementImpl<SOAPBody>
-
- org.apache.axis2.saaj.SOAPBodyImpl
-
- All Implemented Interfaces:
Node,SOAPBody,SOAPElement,Element,Node
public class SOAPBodyImpl extends SOAPElementImpl<SOAPBody> implements SOAPBody
-
-
Field Summary
-
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 SOAPBodyImpl(SOAPBody omSOAPBody)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SOAPElementaddAttribute(QName qname, String value)SOAPBodyElementaddBodyElement(QName qname)Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.SOAPBodyElementaddBodyElement(Name name)Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.SOAPElementaddChildElement(String localName)SOAPElementaddChildElement(String localName, String prefix)SOAPElementaddChildElement(String localName, String prefix, String uri)SOAPElementaddChildElement(QName qname)SOAPElementaddChildElement(SOAPElement soapElement)SOAPBodyElementaddDocument(Document document)Adds the root node of the DOMDocumentto thisSOAPBodyobject.SOAPFaultaddFault()Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(QName faultcode, String faultString)SOAPFaultaddFault(QName faultCode, String faultString, Locale locale)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(Name faultCode, String faultString)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPFaultaddFault(Name faultCode, String faultString, Locale locale)Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.SOAPElementaddTextNode(String text)Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.protected ElementappendElement(Element child)QNamecreateQName(String localName, String prefix)Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.DocumentextractContentAsDocument()Creates a new DOM org.w3c.dom.Document and sets the first child of this SOAPBody as its document element.IteratorgetAllAttributesAsQNames()StringgetAttributeValue(QName qname)IteratorgetChildElements()Returns an iterator over all the immediate content of this element.IteratorgetChildElements(QName qname)IteratorgetChildElements(Name name)QNamegetElementQName()SOAPFaultgetFault()Returns theSOAPFaultobject in thisSOAPBodyobject.booleanhasFault()Indicates whether aSOAPFaultobject exists in thisSOAPBodyobject.booleanremoveAttribute(QName qname)SOAPElementsetElementQName(QName qname)-
Methods inherited from class org.apache.axis2.saaj.SOAPElementImpl
addAttribute, addChildElement, addNamespaceDeclaration, clone, copyContents, getAllAttributes, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributeValue, getElementName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getTagName, getValue, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeContents, removeNamespaceDeclaration, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setEncodingStyle, setValue, toString
-
Methods inherited from class org.apache.axis2.saaj.NodeImpl
detachNode, getParentElement, setParentElement
-
Methods inherited from class org.apache.axis2.saaj.ProxyNode
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOMTarget, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSchemaTypeInfo, getTarget, getTextContent, getType, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, removeChild, replaceChild, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setType, setUserData, toSAAJNodeList
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
-
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Methods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addChildElement, addNamespaceDeclaration, getAllAttributes, getAttributeValue, getElementName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
-
-
-
-
Constructor Detail
-
SOAPBodyImpl
public SOAPBodyImpl(SOAPBody omSOAPBody)
- Parameters:
omSOAPBody-
-
-
Method Detail
-
addChildElement
public SOAPElement addChildElement(String localName) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
appendElement
protected Element appendElement(Element child) throws SOAPException
- Overrides:
appendElementin classProxyNode<Element,SOAPBody>- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
addFault
public SOAPFault addFault() throws SOAPException
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.- Specified by:
addFaultin interfaceSOAPBody- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error
-
hasFault
public boolean hasFault()
Indicates whether aSOAPFaultobject exists in thisSOAPBodyobject.
-
getFault
public SOAPFault getFault()
Returns theSOAPFaultobject in thisSOAPBodyobject.
-
addBodyElement
public SOAPBodyElement addBodyElement(Name name) throws SOAPException
Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.- Specified by:
addBodyElementin interfaceSOAPBody- Parameters:
name- aNameobject with the name for the newSOAPBodyElementobject- Returns:
- the new
SOAPBodyElementobject - Throws:
SOAPException- if a SOAP error occurs
-
addFault
public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The newSOAPFaultwill have afaultcodeelement that is set to thefaultCodeparameter and afaultstringset tofaultstringand localized tolocale.- Specified by:
addFaultin interfaceSOAPBody- Parameters:
faultCode- aNameobject giving the fault code to be set; must be one of the fault codes defined in the SOAP 1.1 specification and of type QNamefaultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString - Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error
-
addFault
public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The newSOAPFaultwill have afaultcodeelement that is set to thefaultCodeparameter and afaultstringset tofaultstring.- Specified by:
addFaultin interfaceSOAPBody- Parameters:
faultCode- aNameobject giving the fault code to be set; must be one of the fault codes defined in the SOAP 1.1 specification and of type QNamefaultString- aStringgiving an explanation of the fault- Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error
-
addDocument
public SOAPBodyElement addDocument(Document document) throws SOAPException
Adds the root node of the DOMDocumentto thisSOAPBodyobject. Calling this method invalidates thedocumentparameter. The client application should discard all references to thisDocumentand its contents upon callingaddDocument. The behavior of an application that continues to use such references is undefined.- Specified by:
addDocumentin interfaceSOAPBody- Parameters:
document- theDocumentobject whose root node will be added to thisSOAPBody- Returns:
- the
SOAPBodyElementthat represents the root node that was added - Throws:
SOAPException- if theDocumentcannot be added
-
addBodyElement
public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.- Specified by:
addBodyElementin interfaceSOAPBody- Parameters:
qname- aQNameobject with the name for the newSOAPBodyElementobject- Returns:
- the new
SOAPBodyElementobject - Throws:
SOAPException- if a SOAP error occurs
-
addFault
public SOAPFault addFault(QName faultcode, String faultString) throws SOAPException
- Specified by:
addFaultin interfaceSOAPBody- Throws:
SOAPException
-
addFault
public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject. The newSOAPFaultwill have afaultcodeelement that is set to thefaultCodeparameter and afaultstringset tofaultstringand localized tolocale.- Specified by:
addFaultin interfaceSOAPBody- Parameters:
faultCode- aQNameobject giving the fault code to befaultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString - Returns:
- the new
SOAPFaultobject - Throws:
SOAPException- if there is a SOAP error
-
extractContentAsDocument
public Document extractContentAsDocument() throws SOAPException
Creates a new DOM org.w3c.dom.Document and sets the first child of this SOAPBody as its document element. The child SOAPElement is removed as part of the process.- Specified by:
extractContentAsDocumentin interfaceSOAPBody- Returns:
- The org.w3c.dom.Document representation of the SOAPBody content.
- Throws:
SOAPException- - if there is not exactly one child SOAPElement of the SOAPBody.
-
getChildElements
public Iterator getChildElements(Name name)
- Specified by:
getChildElementsin interfaceSOAPElement- Overrides:
getChildElementsin classSOAPElementImpl<SOAPBody>
-
addAttribute
public SOAPElement addAttribute(QName qname, String value) throws SOAPException
- Specified by:
addAttributein interfaceSOAPElement- Overrides:
addAttributein classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(QName qname) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
createQName
public QName createQName(String localName, String prefix) throws SOAPException
Description copied from class:SOAPElementImplCreates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement. The remaining elements of the new QName are taken directly from the parameters, localName and prefix.- Specified by:
createQNamein interfaceSOAPElement- Overrides:
createQNamein classSOAPElementImpl<SOAPBody>- Parameters:
localName- - a String containing the local part of the name. prefix - a String containing the prefix for the name.- Returns:
- a QName with the specified localName and prefix, and with a namespace that is associated with the prefix in the context of this SOAPElement. This namespace will be the same as the one that would be returned by getNamespaceURI(String) if it were given prefix as its parameter.
- Throws:
SOAPException- - if the QName cannot be created.
-
getAllAttributesAsQNames
public Iterator getAllAttributesAsQNames()
- Specified by:
getAllAttributesAsQNamesin interfaceSOAPElement- Overrides:
getAllAttributesAsQNamesin classSOAPElementImpl<SOAPBody>
-
getAttributeValue
public String getAttributeValue(QName qname)
- Specified by:
getAttributeValuein interfaceSOAPElement- Overrides:
getAttributeValuein classSOAPElementImpl<SOAPBody>
-
getChildElements
public Iterator getChildElements(QName qname)
- Specified by:
getChildElementsin interfaceSOAPElement- Overrides:
getChildElementsin classSOAPElementImpl<SOAPBody>
-
getElementQName
public QName getElementQName()
- Specified by:
getElementQNamein interfaceSOAPElement- Overrides:
getElementQNamein classSOAPElementImpl<SOAPBody>
-
removeAttribute
public boolean removeAttribute(QName qname)
- Specified by:
removeAttributein interfaceSOAPElement- Overrides:
removeAttributein classSOAPElementImpl<SOAPBody>
-
setElementQName
public SOAPElement setElementQName(QName qname) throws SOAPException
- Specified by:
setElementQNamein interfaceSOAPElement- Overrides:
setElementQNamein classSOAPElementImpl<SOAPBody>- Throws:
SOAPException
-
getChildElements
public Iterator getChildElements()
Description copied from class:SOAPElementImplReturns an iterator over all the immediate content of this element. This includesTextobjects as well asSOAPElementobjects.- Specified by:
getChildElementsin interfaceSOAPElement- Overrides:
getChildElementsin classSOAPElementImpl<SOAPBody>- Returns:
- an iterator over
TextandSOAPElementcontained within thisSOAPElementobject
-
addTextNode
public SOAPElement addTextNode(String text) throws SOAPException
Description copied from class:SOAPElementImplCreates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.- Specified by:
addTextNodein interfaceSOAPElement- Overrides:
addTextNodein classSOAPElementImpl<SOAPBody>- 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
-
-