Class SOAPBodyImpl

All Implemented Interfaces:
jakarta.xml.soap.Node, jakarta.xml.soap.SOAPBody, jakarta.xml.soap.SOAPElement, Element, Node

public class SOAPBodyImpl extends SOAPElementImpl<org.apache.axiom.soap.SOAPBody> implements jakarta.xml.soap.SOAPBody
  • Constructor Details

    • SOAPBodyImpl

      public SOAPBodyImpl(org.apache.axiom.soap.SOAPBody omSOAPBody)
      Parameters:
      omSOAPBody -
  • Method Details

    • addChildElement

      public jakarta.xml.soap.SOAPElement addChildElement(String localName) throws jakarta.xml.soap.SOAPException
      Specified by:
      addChildElement in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addChildElement in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • addChildElement

      public jakarta.xml.soap.SOAPElement addChildElement(String localName, String prefix) throws jakarta.xml.soap.SOAPException
      Specified by:
      addChildElement in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addChildElement in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • appendElement

      protected Element appendElement(Element child) throws jakarta.xml.soap.SOAPException
      Overrides:
      appendElement in class ProxyNode<Element,org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • addChildElement

      public jakarta.xml.soap.SOAPElement addChildElement(jakarta.xml.soap.SOAPElement soapElement) throws jakarta.xml.soap.SOAPException
      Specified by:
      addChildElement in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addChildElement in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • addChildElement

      public jakarta.xml.soap.SOAPElement addChildElement(String localName, String prefix, String uri) throws jakarta.xml.soap.SOAPException
      Specified by:
      addChildElement in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addChildElement in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • addFault

      public jakarta.xml.soap.SOAPFault addFault() throws jakarta.xml.soap.SOAPException
      Creates a new SOAPFault object and adds it to this SOAPBody object.
      Specified by:
      addFault in interface jakarta.xml.soap.SOAPBody
      Returns:
      the new SOAPFault object
      Throws:
      jakarta.xml.soap.SOAPException - if there is a SOAP error
    • hasFault

      public boolean hasFault()
      Indicates whether a SOAPFault object exists in this SOAPBody object.
      Specified by:
      hasFault in interface jakarta.xml.soap.SOAPBody
      Returns:
      true if a SOAPFault object exists in this SOAPBody object; false otherwise
    • getFault

      public jakarta.xml.soap.SOAPFault getFault()
      Returns the SOAPFault object in this SOAPBody object.
      Specified by:
      getFault in interface jakarta.xml.soap.SOAPBody
      Returns:
      the SOAPFault object in this SOAPBody object
    • addBodyElement

      public jakarta.xml.soap.SOAPBodyElement addBodyElement(jakarta.xml.soap.Name name) throws jakarta.xml.soap.SOAPException
      Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
      Specified by:
      addBodyElement in interface jakarta.xml.soap.SOAPBody
      Parameters:
      name - a Name object with the name for the new SOAPBodyElement object
      Returns:
      the new SOAPBodyElement object
      Throws:
      jakarta.xml.soap.SOAPException - if a SOAP error occurs
    • addFault

      public jakarta.xml.soap.SOAPFault addFault(jakarta.xml.soap.Name faultCode, String faultString, Locale locale) throws jakarta.xml.soap.SOAPException
      Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have a faultcode element that is set to the faultCode parameter and a faultstring set to faultstring and localized to locale.
      Specified by:
      addFault in interface jakarta.xml.soap.SOAPBody
      Parameters:
      faultCode - a Name 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 QName
      faultString - a String giving an explanation of the fault
      locale - a Locale object indicating the native language of the faultString
      Returns:
      the new SOAPFault object
      Throws:
      jakarta.xml.soap.SOAPException - if there is a SOAP error
    • addFault

      public jakarta.xml.soap.SOAPFault addFault(jakarta.xml.soap.Name faultCode, String faultString) throws jakarta.xml.soap.SOAPException
      Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have a faultcode element that is set to the faultCode parameter and a faultstring set to faultstring.
      Specified by:
      addFault in interface jakarta.xml.soap.SOAPBody
      Parameters:
      faultCode - a Name 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 QName
      faultString - a String giving an explanation of the fault
      Returns:
      the new SOAPFault object
      Throws:
      jakarta.xml.soap.SOAPException - if there is a SOAP error
    • addDocument

      public jakarta.xml.soap.SOAPBodyElement addDocument(Document document) throws jakarta.xml.soap.SOAPException
      Adds the root node of the DOM Document to this SOAPBody object.

      Calling this method invalidates the document parameter. The client application should discard all references to this Document and its contents upon calling addDocument. The behavior of an application that continues to use such references is undefined.

      Specified by:
      addDocument in interface jakarta.xml.soap.SOAPBody
      Parameters:
      document - the Document object whose root node will be added to this SOAPBody
      Returns:
      the SOAPBodyElement that represents the root node that was added
      Throws:
      jakarta.xml.soap.SOAPException - if the Document cannot be added
    • addBodyElement

      public jakarta.xml.soap.SOAPBodyElement addBodyElement(QName qname) throws jakarta.xml.soap.SOAPException
      Creates a new SOAPBodyElement object with the specified name and adds it to this SOAPBody object.
      Specified by:
      addBodyElement in interface jakarta.xml.soap.SOAPBody
      Parameters:
      qname - a QName object with the name for the new SOAPBodyElement object
      Returns:
      the new SOAPBodyElement object
      Throws:
      jakarta.xml.soap.SOAPException - if a SOAP error occurs
    • addFault

      public jakarta.xml.soap.SOAPFault addFault(QName faultcode, String faultString) throws jakarta.xml.soap.SOAPException
      Specified by:
      addFault in interface jakarta.xml.soap.SOAPBody
      Throws:
      jakarta.xml.soap.SOAPException
    • addFault

      public jakarta.xml.soap.SOAPFault addFault(QName faultCode, String faultString, Locale locale) throws jakarta.xml.soap.SOAPException
      Creates a new SOAPFault object and adds it to this SOAPBody object. The new SOAPFault will have a faultcode element that is set to the faultCode parameter and a faultstring set to faultstring and localized to locale.
      Specified by:
      addFault in interface jakarta.xml.soap.SOAPBody
      Parameters:
      faultCode - a QName object giving the fault code to be
      faultString - a String giving an explanation of the fault
      locale - a Locale object indicating the native language of the faultString
      Returns:
      the new SOAPFault object
      Throws:
      jakarta.xml.soap.SOAPException - if there is a SOAP error
    • extractContentAsDocument

      public Document extractContentAsDocument() throws jakarta.xml.soap.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 interface jakarta.xml.soap.SOAPBody
      Returns:
      The org.w3c.dom.Document representation of the SOAPBody content.
      Throws:
      jakarta.xml.soap.SOAPException - - if there is not exactly one child SOAPElement of the SOAPBody.
    • getChildElements

      public Iterator getChildElements(jakarta.xml.soap.Name name)
      Specified by:
      getChildElements in interface jakarta.xml.soap.SOAPElement
      Overrides:
      getChildElements in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
    • addAttribute

      public jakarta.xml.soap.SOAPElement addAttribute(QName qname, String value) throws jakarta.xml.soap.SOAPException
      Specified by:
      addAttribute in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addAttribute in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • addChildElement

      public jakarta.xml.soap.SOAPElement addChildElement(QName qname) throws jakarta.xml.soap.SOAPException
      Specified by:
      addChildElement in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addChildElement in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • createQName

      public QName createQName(String localName, String prefix) throws jakarta.xml.soap.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 interface jakarta.xml.soap.SOAPElement
      Overrides:
      createQName in class SOAPElementImpl<org.apache.axiom.soap.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:
      jakarta.xml.soap.SOAPException - - if the QName cannot be created.
    • getAllAttributesAsQNames

      public Iterator getAllAttributesAsQNames()
      Specified by:
      getAllAttributesAsQNames in interface jakarta.xml.soap.SOAPElement
      Overrides:
      getAllAttributesAsQNames in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
    • getAttributeValue

      public String getAttributeValue(QName qname)
      Specified by:
      getAttributeValue in interface jakarta.xml.soap.SOAPElement
      Overrides:
      getAttributeValue in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
    • getChildElements

      public Iterator getChildElements(QName qname)
      Specified by:
      getChildElements in interface jakarta.xml.soap.SOAPElement
      Overrides:
      getChildElements in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
    • getElementQName

      public QName getElementQName()
      Specified by:
      getElementQName in interface jakarta.xml.soap.SOAPElement
      Overrides:
      getElementQName in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
    • removeAttribute

      public boolean removeAttribute(QName qname)
      Specified by:
      removeAttribute in interface jakarta.xml.soap.SOAPElement
      Overrides:
      removeAttribute in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
    • setElementQName

      public jakarta.xml.soap.SOAPElement setElementQName(QName qname) throws jakarta.xml.soap.SOAPException
      Specified by:
      setElementQName in interface jakarta.xml.soap.SOAPElement
      Overrides:
      setElementQName in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Throws:
      jakarta.xml.soap.SOAPException
    • getChildElements

      public Iterator getChildElements()
      Description copied from class: SOAPElementImpl
      Returns an iterator over all the immediate content of this element. This includes Text objects as well as SOAPElement objects.
      Specified by:
      getChildElements in interface jakarta.xml.soap.SOAPElement
      Overrides:
      getChildElements in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Returns:
      an iterator over Text and SOAPElement contained within this SOAPElement object
    • addTextNode

      public jakarta.xml.soap.SOAPElement addTextNode(String text) throws jakarta.xml.soap.SOAPException
      Description copied from class: SOAPElementImpl
      Creates a new Text object initialized with the given String and adds it to this SOAPElement object.
      Specified by:
      addTextNode in interface jakarta.xml.soap.SOAPElement
      Overrides:
      addTextNode in class SOAPElementImpl<org.apache.axiom.soap.SOAPBody>
      Parameters:
      text - a String object with the textual content to be added
      Returns:
      the SOAPElement object into which the new Text object was inserted
      Throws:
      jakarta.xml.soap.SOAPException - if there is an error in creating the new Text object