Package org.apache.axis2.saaj
Class SOAPBodyImpl
java.lang.Object
org.apache.axiom.om.impl.dom.NodeImpl
org.apache.axis2.saaj.NodeImplEx
org.apache.axis2.saaj.SOAPElementImpl
org.apache.axis2.saaj.SOAPBodyImpl
- All Implemented Interfaces:
Cloneable,Node,SOAPBody,SOAPElement,org.apache.axiom.om.impl.OMNodeEx,org.apache.axiom.om.OMNode,org.apache.axiom.om.OMSerializable,Element,Node,NodeList
-
Field Summary
Fields inherited from class org.apache.axis2.saaj.SOAPElementImpl
elementFields inherited from class org.apache.axis2.saaj.NodeImplEx
parentElementFields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
builder, done, factory, FIRSTCHILD, flags, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIEDFields 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_NODEFields inherited from interface org.apache.axiom.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(QName qname, String value) addBodyElement(QName qname) Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.addBodyElement(Name name) Creates a newSOAPBodyElementobject with the specified name and adds it to thisSOAPBodyobject.addChildElement(String localName) addChildElement(String localName, String prefix) addChildElement(String localName, String prefix, String uri) addChildElement(QName qname) addChildElement(SOAPElement soapElement) addDocument(Document document) Adds the root node of the DOMDocumentto thisSOAPBodyobject.addFault()Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.Creates a newSOAPFaultobject and adds it to thisSOAPBodyobject.addTextNode(String text) Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.protected ElementappendElement(org.apache.axiom.om.impl.dom.ElementImpl child) 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.org.apache.axiom.om.OMNodedetach()voidRemoves thisNodeobject from the tree.Creates a new DOM org.w3c.dom.Document and sets the first child of this SOAPBody as its document element.getAttributeValue(QName qname) Returns an iterator over all the immediate content of this element.getChildElements(QName qname) getChildElements(Name name) getFault()Returns theSOAPFaultobject in thisSOAPBodyobject.booleanhasFault()Indicates whether aSOAPFaultobject exists in thisSOAPBodyobject.booleanremoveAttribute(QName qname) setElementQName(QName qname) Methods inherited from class org.apache.axis2.saaj.SOAPElementImpl
addAttribute, addChildElement, addNamespaceDeclaration, appendChild, appendText, clone, copyContents, discard, getAllAttributes, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getChildNodes, getElement, getElementName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getFirstChild, getLastChild, getLocalName, getNamespacePrefixes, getNamespaceURI, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTagName, getTextContent, getValue, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, hasChildNodes, internalSerialize, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeContents, removeNamespaceDeclaration, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setEncodingStyle, setParent, setParentElement, setValue, toStringMethods inherited from class org.apache.axis2.saaj.NodeImplEx
getParent, getSchemaTypeInfo, getType, recycleNode, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setTypeMethods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
build, buildWithAttachments, cloneNode, close, compareDocumentPosition, getBaseURI, getFeature, getLength, getNextOMSibling, getNextOMSiblingIfAvailable, getNodeValue, getOMFactory, getPreviousOMSibling, getUserData, hasAttributes, insertBefore, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, replaceChild, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setNodeValue, setOwnerDocument, setPrefix, setPreviousOMSibling, setTextContent, setUserDataMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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, setIdAttributeNSMethods inherited from interface javax.xml.soap.Node
getParentElement, getValue, recycleNode, setParentElement, setValueMethods 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, setUserDataMethods inherited from interface javax.xml.soap.SOAPElement
addAttribute, addChildElement, addNamespaceDeclaration, getAllAttributes, getAttributeValue, getElementName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
-
Constructor Details
-
SOAPBodyImpl
public SOAPBodyImpl(org.apache.axiom.soap.SOAPBody omSOAPBody) - Parameters:
omSOAPBody-
-
-
Method Details
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl- Throws:
SOAPException
-
appendElement
protected Element appendElement(org.apache.axiom.om.impl.dom.ElementImpl child) throws SOAPException - Overrides:
appendElementin classSOAPElementImpl- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException - Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl- Throws:
SOAPException
-
addFault
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
Returns theSOAPFaultobject in thisSOAPBodyobject. -
addBodyElement
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
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
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
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
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
- Specified by:
addFaultin interfaceSOAPBody- Throws:
SOAPException
-
addFault
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
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.
-
detachNode
public void detachNode()Description copied from class:NodeImplExRemoves thisNodeobject from the tree. Once removed, this node can be garbage collected if there are no application references to it.- Specified by:
detachNodein interfaceNode- Overrides:
detachNodein classSOAPElementImpl
-
detach
public org.apache.axiom.om.OMNode detach()- Specified by:
detachin interfaceorg.apache.axiom.om.OMNode- Overrides:
detachin classSOAPElementImpl
-
getChildElements
- Specified by:
getChildElementsin interfaceSOAPElement- Overrides:
getChildElementsin classSOAPElementImpl
-
addAttribute
- Specified by:
addAttributein interfaceSOAPElement- Overrides:
addAttributein classSOAPElementImpl- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classSOAPElementImpl- Throws:
SOAPException
-
createQName
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- 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
- Specified by:
getAllAttributesAsQNamesin interfaceSOAPElement- Overrides:
getAllAttributesAsQNamesin classSOAPElementImpl
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceSOAPElement- Overrides:
getAttributeValuein classSOAPElementImpl
-
getChildElements
- Specified by:
getChildElementsin interfaceSOAPElement- Overrides:
getChildElementsin classSOAPElementImpl
-
getElementQName
- Specified by:
getElementQNamein interfaceSOAPElement- Overrides:
getElementQNamein classSOAPElementImpl
-
removeAttribute
- Specified by:
removeAttributein interfaceSOAPElement- Overrides:
removeAttributein classSOAPElementImpl
-
setElementQName
- Specified by:
setElementQNamein interfaceSOAPElement- Overrides:
setElementQNamein classSOAPElementImpl- Throws:
SOAPException
-
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- Returns:
- an iterator over
TextandSOAPElementcontained within thisSOAPElementobject
-
addTextNode
Description copied from class:SOAPElementImplCreates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.- Specified by:
addTextNodein interfaceSOAPElement- Overrides:
addTextNodein classSOAPElementImpl- 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
-