java.lang.Object
com.sun.xml.messaging.saaj.soap.impl.ElementImpl
com.sun.xml.messaging.saaj.soap.impl.FaultImpl
All Implemented Interfaces:
Node, SOAPBodyElement, SOAPElement, SOAPFault, Element, Node
Direct Known Subclasses:
Fault1_1Impl, Fault1_2Impl

public abstract class FaultImpl extends ElementImpl implements SOAPFault
  • Field Details

  • Constructor Details

  • Method Details

    • getDetailName

      protected abstract NameImpl getDetailName()
    • getFaultCodeName

      protected abstract NameImpl getFaultCodeName()
    • getFaultStringName

      protected abstract NameImpl getFaultStringName()
    • getFaultActorName

      protected abstract NameImpl getFaultActorName()
    • createDetail

      protected abstract DetailImpl createDetail()
    • createSOAPFaultElement

      protected abstract FaultElementImpl createSOAPFaultElement(String localName)
    • createSOAPFaultElement

      protected abstract FaultElementImpl createSOAPFaultElement(QName qname)
    • createSOAPFaultElement

      protected abstract FaultElementImpl createSOAPFaultElement(Name qname)
    • checkIfStandardFaultCode

      protected abstract void checkIfStandardFaultCode(String faultCode, String uri) throws SOAPException
      Throws:
      SOAPException
    • finallySetFaultCode

      protected abstract void finallySetFaultCode(String faultcode) throws SOAPException
      Throws:
      SOAPException
    • isStandardFaultElement

      protected abstract boolean isStandardFaultElement(String localName)
    • getDefaultFaultCode

      protected abstract QName getDefaultFaultCode()
    • findFaultCodeElement

      protected void findFaultCodeElement()
    • findFaultActorElement

      protected void findFaultActorElement()
    • findFaultStringElement

      protected void findFaultStringElement()
    • setFaultCode

      public void setFaultCode(String faultCode) throws SOAPException
      Description copied from interface: SOAPFault
      Sets this SOAPFault object with the give fault code.

      Fault codes, which given information about the fault, are defined in the SOAP 1.1 specification. This element is mandatory in SOAP 1.1. Because the fault code is required to be a QName it is preferable to use the SOAPFault.setFaultCode(Name) form of this method.

      Specified by:
      setFaultCode in interface SOAPFault
      Parameters:
      faultCode - a String giving the fault code to be set. It must be of the form "prefix:localName" where the prefix has been defined in a namespace declaration.
      Throws:
      SOAPException - if there was an error in adding the faultCode to the underlying XML tree.
      See Also:
    • setFaultCode

      public void setFaultCode(String faultCode, String prefix, String uri) throws SOAPException
      Throws:
      SOAPException
    • setFaultCode

      public void setFaultCode(Name faultCodeQName) throws SOAPException
      Description copied from interface: SOAPFault
      Sets this SOAPFault object with the given fault code.

      Fault codes, which give information about the fault, are defined in the SOAP 1.1 specification. A fault code is mandatory and must be of type Name. This method provides a convenient way to set a fault code. For example,

       SOAPEnvelope se = ...;
       // Create a qualified name in the SOAP namespace with a localName
       // of "Client". Note that prefix parameter is optional and is null
       // here which causes the implementation to use an appropriate prefix.
       Name qname = se.createName("Client", null,
                                  SOAPConstants.URI_NS_SOAP_ENVELOPE);
       SOAPFault fault = ...;
       fault.setFaultCode(qname);
      
      It is preferable to use this method over SOAPFault.setFaultCode(String).
      Specified by:
      setFaultCode in interface SOAPFault
      Parameters:
      faultCodeQName - a Name object giving the fault code to be set. It must be namespace qualified.
      Throws:
      SOAPException - if there was an error in adding the faultcode element to the underlying XML tree.
      See Also:
    • setFaultCode

      public void setFaultCode(QName faultCodeQName) throws SOAPException
      Description copied from interface: SOAPFault
      Sets this SOAPFault object with the given fault code.

      It is preferable to use this method over SOAPFault.setFaultCode(Name).

      Specified by:
      setFaultCode in interface SOAPFault
      Parameters:
      faultCodeQName - a QName object giving the fault code to be set. It must be namespace qualified.
      Throws:
      SOAPException - if there was an error in adding the faultcode element to the underlying XML tree.
      See Also:
    • convertCodeToQName

      protected static QName convertCodeToQName(String code, SOAPElement codeContainingElement)
    • initializeDetail

      protected void initializeDetail()
    • getDetail

      public Detail getDetail()
      Description copied from interface: SOAPFault
      Returns the optional detail element for this SOAPFault object.

      A Detail object carries application-specific error information, the scope of the error information is restricted to faults in the SOAPBodyElement objects if this is a SOAP 1.1 Fault.

      Specified by:
      getDetail in interface SOAPFault
      Returns:
      a Detail object with application-specific error information if present, null otherwise
    • addDetail

      public Detail addDetail() throws SOAPException
      Description copied from interface: SOAPFault
      Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.

      It is illegal to add a detail when the fault already contains a detail. Therefore, this method should be called only after the existing detail has been removed.

      Specified by:
      addDetail in interface SOAPFault
      Returns:
      the new Detail object
      Throws:
      SOAPException - if this SOAPFault object already contains a valid Detail object
    • hasDetail

      public boolean hasDetail()
      Description copied from interface: SOAPFault
      Returns true if this SOAPFault has a Detail subelement and false otherwise. Equivalent to (getDetail()!=null).
      Specified by:
      hasDetail in interface SOAPFault
      Returns:
      true if this SOAPFault has a Detail subelement and false otherwise.
    • setFaultActor

      public abstract void setFaultActor(String faultActor) throws SOAPException
      Description copied from interface: SOAPFault
      Sets this SOAPFault object with the given fault actor.

      The fault actor is the recipient in the message path who caused the fault to happen.

      If this SOAPFault supports SOAP 1.2 then this call is equivalent to SOAPFault.setFaultRole(String)

      Specified by:
      setFaultActor in interface SOAPFault
      Parameters:
      faultActor - a String identifying the actor that caused this SOAPFault object
      Throws:
      SOAPException - if there was an error in adding the faultActor to the underlying XML tree.
      See Also:
    • getFaultActor

      public String getFaultActor()
      Description copied from interface: SOAPFault
      Gets the fault actor for this SOAPFault object.

      If this SOAPFault supports SOAP 1.2 then this call is equivalent to SOAPFault.getFaultRole()

      Specified by:
      getFaultActor in interface SOAPFault
      Returns:
      a String giving the actor in the message path that caused this SOAPFault object
      See Also:
    • setElementQName

      public SOAPElement setElementQName(QName newName) throws SOAPException
      Description copied from interface: SOAPElement
      Changes the name of this Element to newName if possible. SOAP Defined elements such as SOAPEnvelope, SOAPHeader, SOAPBody etc. cannot have their names changed using this method. Any attempt to do so will result in a SOAPException being thrown.

      Callers should not rely on the element instance being renamed as is. Implementations could end up copying the content of the SOAPElement to a renamed instance.

      Specified by:
      setElementQName in interface SOAPElement
      Overrides:
      setElementQName in class ElementImpl
      Parameters:
      newName - the new name for the Element.
      Returns:
      The renamed Node
      Throws:
      SOAPException - if changing the name of this Element is not allowed.
    • convertToSoapElement

      protected SOAPElement convertToSoapElement(Element element)
      Overrides:
      convertToSoapElement in class ElementImpl
    • addFaultCodeElement

      protected SOAPFaultElement addFaultCodeElement() throws SOAPException
      Throws:
      SOAPException
    • addElement

      protected SOAPElement addElement(Name name) throws SOAPException
      Overrides:
      addElement in class ElementImpl
      Throws:
      SOAPException
    • addElement

      protected SOAPElement addElement(QName name) throws SOAPException
      Overrides:
      addElement in class ElementImpl
      Throws:
      SOAPException
    • addSOAPFaultElement

      protected FaultElementImpl addSOAPFaultElement(String localName) throws SOAPException
      Throws:
      SOAPException
    • xmlLangToLocale

      protected static Locale xmlLangToLocale(String xmlLang)
      Convert an xml:lang attribute value into a Locale object
      Parameters:
      xmlLang - xml:lang attribute value
      Returns:
      Locale
    • localeToXmlLang

      protected static String localeToXmlLang(Locale locale)