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 SOAPElement
addAttribute(QName qname, String value)
SOAPBodyElement
addBodyElement(QName qname)
Creates a newSOAPBodyElement
object with the specified name and adds it to thisSOAPBody
object.SOAPBodyElement
addBodyElement(Name name)
Creates a newSOAPBodyElement
object with the specified name and adds it to thisSOAPBody
object.SOAPElement
addChildElement(String localName)
SOAPElement
addChildElement(String localName, String prefix)
SOAPElement
addChildElement(String localName, String prefix, String uri)
SOAPElement
addChildElement(QName qname)
SOAPElement
addChildElement(SOAPElement soapElement)
SOAPBodyElement
addDocument(Document document)
Adds the root node of the DOMDocument
to thisSOAPBody
object.SOAPFault
addFault()
Creates a newSOAPFault
object and adds it to thisSOAPBody
object.SOAPFault
addFault(QName faultcode, String faultString)
SOAPFault
addFault(QName faultCode, String faultString, Locale locale)
Creates a newSOAPFault
object and adds it to thisSOAPBody
object.SOAPFault
addFault(Name faultCode, String faultString)
Creates a newSOAPFault
object and adds it to thisSOAPBody
object.SOAPFault
addFault(Name faultCode, String faultString, Locale locale)
Creates a newSOAPFault
object and adds it to thisSOAPBody
object.SOAPElement
addTextNode(String text)
Creates a newText
object initialized with the givenString
and adds it to thisSOAPElement
object.protected Element
appendElement(Element child)
QName
createQName(String localName, String prefix)
Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.Document
extractContentAsDocument()
Creates a new DOM org.w3c.dom.Document and sets the first child of this SOAPBody as its document element.Iterator
getAllAttributesAsQNames()
String
getAttributeValue(QName qname)
Iterator
getChildElements()
Returns an iterator over all the immediate content of this element.Iterator
getChildElements(QName qname)
Iterator
getChildElements(Name name)
QName
getElementQName()
SOAPFault
getFault()
Returns theSOAPFault
object in thisSOAPBody
object.boolean
hasFault()
Indicates whether aSOAPFault
object exists in thisSOAPBody
object.boolean
removeAttribute(QName qname)
SOAPElement
setElementQName(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:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
appendElement
protected Element appendElement(Element child) throws SOAPException
- Overrides:
appendElement
in classProxyNode<Element,SOAPBody>
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
addFault
public SOAPFault addFault() throws SOAPException
Creates a newSOAPFault
object and adds it to thisSOAPBody
object.- Specified by:
addFault
in interfaceSOAPBody
- Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error
-
hasFault
public boolean hasFault()
Indicates whether aSOAPFault
object exists in thisSOAPBody
object.
-
getFault
public SOAPFault getFault()
Returns theSOAPFault
object in thisSOAPBody
object.
-
addBodyElement
public SOAPBodyElement addBodyElement(Name name) throws SOAPException
Creates a newSOAPBodyElement
object with the specified name and adds it to thisSOAPBody
object.- Specified by:
addBodyElement
in interfaceSOAPBody
- Parameters:
name
- aName
object with the name for the newSOAPBodyElement
object- Returns:
- the new
SOAPBodyElement
object - Throws:
SOAPException
- if a SOAP error occurs
-
addFault
public SOAPFault addFault(Name faultCode, String faultString, Locale locale) throws SOAPException
Creates a newSOAPFault
object and adds it to thisSOAPBody
object. The newSOAPFault
will have afaultcode
element that is set to thefaultCode
parameter and afaultstring
set tofaultstring
and localized tolocale
.- Specified by:
addFault
in interfaceSOAPBody
- Parameters:
faultCode
- aName
object 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
- aString
giving an explanation of the faultlocale
- aLocale
object indicating the native language of thefaultString - Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error
-
addFault
public SOAPFault addFault(Name faultCode, String faultString) throws SOAPException
Creates a newSOAPFault
object and adds it to thisSOAPBody
object. The newSOAPFault
will have afaultcode
element that is set to thefaultCode
parameter and afaultstring
set tofaultstring
.- Specified by:
addFault
in interfaceSOAPBody
- Parameters:
faultCode
- aName
object 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
- aString
giving an explanation of the fault- Returns:
- the new
SOAPFault
object - Throws:
SOAPException
- if there is a SOAP error
-
addDocument
public SOAPBodyElement addDocument(Document document) throws SOAPException
Adds the root node of the DOMDocument
to thisSOAPBody
object. Calling this method invalidates thedocument
parameter. The client application should discard all references to thisDocument
and its contents upon callingaddDocument
. The behavior of an application that continues to use such references is undefined.- Specified by:
addDocument
in interfaceSOAPBody
- Parameters:
document
- theDocument
object whose root node will be added to thisSOAPBody
- Returns:
- the
SOAPBodyElement
that represents the root node that was added - Throws:
SOAPException
- if theDocument
cannot be added
-
addBodyElement
public SOAPBodyElement addBodyElement(QName qname) throws SOAPException
Creates a newSOAPBodyElement
object with the specified name and adds it to thisSOAPBody
object.- Specified by:
addBodyElement
in interfaceSOAPBody
- Parameters:
qname
- aQName
object with the name for the newSOAPBodyElement
object- Returns:
- the new
SOAPBodyElement
object - Throws:
SOAPException
- if a SOAP error occurs
-
addFault
public SOAPFault addFault(QName faultcode, String faultString) throws SOAPException
- Specified by:
addFault
in interfaceSOAPBody
- Throws:
SOAPException
-
addFault
public SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws SOAPException
Creates a newSOAPFault
object and adds it to thisSOAPBody
object. The newSOAPFault
will have afaultcode
element that is set to thefaultCode
parameter and afaultstring
set tofaultstring
and localized tolocale
.- Specified by:
addFault
in interfaceSOAPBody
- Parameters:
faultCode
- aQName
object giving the fault code to befaultString
- aString
giving an explanation of the faultlocale
- aLocale
object indicating the native language of thefaultString - Returns:
- the new
SOAPFault
object - 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:
extractContentAsDocument
in 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:
getChildElements
in interfaceSOAPElement
- Overrides:
getChildElements
in classSOAPElementImpl<SOAPBody>
-
addAttribute
public SOAPElement addAttribute(QName qname, String value) throws SOAPException
- Specified by:
addAttribute
in interfaceSOAPElement
- Overrides:
addAttribute
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(QName qname) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Overrides:
addChildElement
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
createQName
public QName createQName(String localName, String prefix) throws SOAPException
Description copied from class:SOAPElementImpl
Creates 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:
createQName
in interfaceSOAPElement
- Overrides:
createQName
in 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:
getAllAttributesAsQNames
in interfaceSOAPElement
- Overrides:
getAllAttributesAsQNames
in classSOAPElementImpl<SOAPBody>
-
getAttributeValue
public String getAttributeValue(QName qname)
- Specified by:
getAttributeValue
in interfaceSOAPElement
- Overrides:
getAttributeValue
in classSOAPElementImpl<SOAPBody>
-
getChildElements
public Iterator getChildElements(QName qname)
- Specified by:
getChildElements
in interfaceSOAPElement
- Overrides:
getChildElements
in classSOAPElementImpl<SOAPBody>
-
getElementQName
public QName getElementQName()
- Specified by:
getElementQName
in interfaceSOAPElement
- Overrides:
getElementQName
in classSOAPElementImpl<SOAPBody>
-
removeAttribute
public boolean removeAttribute(QName qname)
- Specified by:
removeAttribute
in interfaceSOAPElement
- Overrides:
removeAttribute
in classSOAPElementImpl<SOAPBody>
-
setElementQName
public SOAPElement setElementQName(QName qname) throws SOAPException
- Specified by:
setElementQName
in interfaceSOAPElement
- Overrides:
setElementQName
in classSOAPElementImpl<SOAPBody>
- Throws:
SOAPException
-
getChildElements
public Iterator getChildElements()
Description copied from class:SOAPElementImpl
Returns an iterator over all the immediate content of this element. This includesText
objects as well asSOAPElement
objects.- Specified by:
getChildElements
in interfaceSOAPElement
- Overrides:
getChildElements
in classSOAPElementImpl<SOAPBody>
- Returns:
- an iterator over
Text
andSOAPElement
contained within thisSOAPElement
object
-
addTextNode
public SOAPElement addTextNode(String text) throws SOAPException
Description copied from class:SOAPElementImpl
Creates a newText
object initialized with the givenString
and adds it to thisSOAPElement
object.- Specified by:
addTextNode
in interfaceSOAPElement
- Overrides:
addTextNode
in classSOAPElementImpl<SOAPBody>
- Parameters:
text
- aString
object with the textual content to be added- Returns:
- the
SOAPElement
object into which the newText
object was inserted - Throws:
SOAPException
- if there is an error in creating the newText
object
-
-