Class Fault1_1Impl
- java.lang.Object
-
- com.sun.xml.messaging.saaj.soap.impl.ElementImpl
-
- com.sun.xml.messaging.saaj.soap.impl.FaultImpl
-
- com.sun.xml.messaging.saaj.soap.ver1_1.Fault1_1Impl
-
- All Implemented Interfaces:
Node,SOAPBodyElement,SOAPElement,SOAPFault,Element,Node
public class Fault1_1Impl extends FaultImpl
-
-
Field Summary
-
Fields inherited from class com.sun.xml.messaging.saaj.soap.impl.FaultImpl
detail, faultActorElement, faultCodeElement, faultStringElement
-
Fields inherited from class com.sun.xml.messaging.saaj.soap.impl.ElementImpl
DSIG_NS, elementQName, WSU_NS, XENC_NS
-
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 Fault1_1Impl(SOAPDocumentImpl ownerDoc)Fault1_1Impl(SOAPDocumentImpl ownerDocument, String prefix)Fault1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SOAPElementaddChildElement(SOAPElement element)Add aSOAPElementas a child of thisSOAPElementinstance.voidaddFaultReasonText(String text, Locale locale)Appends or replaces a Reason Text item containing the specified text message and an xml:lang derived fromlocale.voidappendFaultSubcode(QName subcode)Adds a Subcode to the end of the sequence of Subcodes contained by thisSOAPFault.protected voidcheckIfStandardFaultCode(String faultCode, String uri)protected DetailImplcreateDetail()protected FaultElementImplcreateSOAPFaultElement(Name qname)protected FaultElementImplcreateSOAPFaultElement(String localName)protected FaultElementImplcreateSOAPFaultElement(QName qname)protected voidfinallySetFaultCode(String faultcode)protected QNamegetDefaultFaultCode()protected NameImplgetDetailName()protected NameImplgetFaultActorName()StringgetFaultCode()Gets the fault code for thisSOAPFaultobject.NamegetFaultCodeAsName()Gets the mandatory SOAP 1.1 fault code for thisSOAPFaultobject as a SAAJNameobject.QNamegetFaultCodeAsQName()Gets the fault code for thisSOAPFaultobject as aQNameobject.protected NameImplgetFaultCodeName()StringgetFaultNode()Returns the optional Node element value for thisSOAPFaultobject.Iterator<Locale>getFaultReasonLocales()Returns anIteratorover a distinct sequence ofLocales for which there are associated Reason Text items.StringgetFaultReasonText(Locale locale)Returns the Reason Text associated with the givenLocale.Iterator<String>getFaultReasonTexts()Returns anIteratorover a sequence ofStringobjects containing all of the Reason Text items for thisSOAPFault.StringgetFaultRole()Returns the optional Role element value for thisSOAPFaultobject.StringgetFaultString()Gets the fault string for thisSOAPFaultobject.LocalegetFaultStringLocale()Gets the locale of the fault string for thisSOAPFaultobject.protected NameImplgetFaultStringName()Iterator<QName>getFaultSubcodes()Gets the Subcodes for thisSOAPFaultas an iterator overQNames.protected booleanisStandardFaultElement(String localName)voidremoveAllFaultSubcodes()Removes any Subcodes that may be contained by thisSOAPFault.voidsetFaultActor(String faultActor)Sets thisSOAPFaultobject with the given fault actor.voidsetFaultCode(String faultCode, String prefix, String uri)voidsetFaultNode(String uri)Creates or replaces any existing Node element value for thisSOAPFaultobject.voidsetFaultRole(String uri)Creates or replaces any existing Role element value for thisSOAPFaultobject.voidsetFaultString(String faultString)Sets the fault string for thisSOAPFaultobject to the given string.voidsetFaultString(String faultString, Locale locale)Sets the fault string for thisSOAPFaultobject to the given string and localized to the given locale.-
Methods inherited from class com.sun.xml.messaging.saaj.soap.impl.FaultImpl
addDetail, addElement, addElement, addFaultCodeElement, addSOAPFaultElement, convertCodeToQName, convertToSoapElement, findFaultActorElement, findFaultCodeElement, findFaultStringElement, getDetail, getFaultActor, hasDetail, initializeDetail, localeToXmlLang, setElementQName, setFaultCode, setFaultCode, setFaultCode, xmlLangToLocale
-
Methods inherited from class com.sun.xml.messaging.saaj.soap.impl.ElementImpl
addAttribute, addAttribute, addCDATA, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addNode, addText, addTextNode, appendChild, cloneNode, compareDocumentPosition, convertToSoapText, createElement, createElement, createQName, detachNode, doGetNamespacePrefixes, ensureNamespaceIsDeclared, findAndConvertChildElement, findChild, findEncodingStyleAttributeName, getAllAttributes, getAllAttributesAsQNames, getAllAttributesFrom, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getAttributeValue, getAttributeValueFrom, getBaseURI, getChildElementNodes, getChildElements, getChildElements, getChildElements, getChildElementsFrom, getChildNodes, getDomElement, getElementName, getElementQName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getFeature, getFirstChild, getLastChild, getLocalName, getLocalPart, getNamespaceAttr, getNamespaceAttrFrom, getNamespaceContextNodes, getNamespaceContextNodes, getNamespacePrefix, getNamespacePrefixes, getNamespaceURI, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPrefix, getPreviousSibling, getQualifiedName, getSchemaTypeInfo, getSoapDocument, getSOAPNamespace, getTagName, getTextContent, getUserData, getValue, getValueNode, getValueNodeStrict, getVisibleNamespacePrefixes, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, importElement, insertBefore, isDefaultNamespace, isEqualNode, isNamespaceQualified, isNamespaceQualified, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, removeAttribute, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeContents, removeNamespaceDeclaration, replaceChild, replaceElementWithSOAPElement, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setEncodingStyle, setEncodingStyleNamespace, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setParentElement, setPrefix, setTextContent, setUserData, setValue, tryToFindEncodingStyleAttributeName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 jakarta.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 jakarta.xml.soap.SOAPElement
addAttribute, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration, setEncodingStyle
-
-
-
-
Constructor Detail
-
Fault1_1Impl
public Fault1_1Impl(SOAPDocumentImpl ownerDocument, String prefix)
-
Fault1_1Impl
public Fault1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement)
-
Fault1_1Impl
public Fault1_1Impl(SOAPDocumentImpl ownerDoc)
-
-
Method Detail
-
getDetailName
protected NameImpl getDetailName()
- Specified by:
getDetailNamein classFaultImpl
-
getFaultCodeName
protected NameImpl getFaultCodeName()
- Specified by:
getFaultCodeNamein classFaultImpl
-
getFaultStringName
protected NameImpl getFaultStringName()
- Specified by:
getFaultStringNamein classFaultImpl
-
getFaultActorName
protected NameImpl getFaultActorName()
- Specified by:
getFaultActorNamein classFaultImpl
-
createDetail
protected DetailImpl createDetail()
- Specified by:
createDetailin classFaultImpl
-
createSOAPFaultElement
protected FaultElementImpl createSOAPFaultElement(String localName)
- Specified by:
createSOAPFaultElementin classFaultImpl
-
checkIfStandardFaultCode
protected void checkIfStandardFaultCode(String faultCode, String uri) throws SOAPException
- Specified by:
checkIfStandardFaultCodein classFaultImpl- Throws:
SOAPException
-
finallySetFaultCode
protected void finallySetFaultCode(String faultcode) throws SOAPException
- Specified by:
finallySetFaultCodein classFaultImpl- Throws:
SOAPException
-
getFaultCode
public String getFaultCode()
Description copied from interface:SOAPFaultGets the fault code for thisSOAPFaultobject.- Returns:
- a
Stringwith the fault code - See Also:
SOAPFault.getFaultCodeAsName(),SOAPFault.setFaultCode(jakarta.xml.soap.Name)
-
getFaultCodeAsName
public Name getFaultCodeAsName()
Description copied from interface:SOAPFaultGets the mandatory SOAP 1.1 fault code for thisSOAPFaultobject as a SAAJNameobject. The SOAP 1.1 specification requires the value of the "faultcode" element to be of type QName. This method returns the content of the element as a QName in the form of a SAAJ Name object. This method should be used instead of thegetFaultCodemethod since it allows applications to easily access the namespace name without additional parsing.- Returns:
- a
Namerepresenting the faultcode - See Also:
SOAPFault.setFaultCode(Name)
-
getFaultCodeAsQName
public QName getFaultCodeAsQName()
Description copied from interface:SOAPFaultGets the fault code for thisSOAPFaultobject as aQNameobject.- Returns:
- a
QNamerepresenting the faultcode - See Also:
SOAPFault.setFaultCode(QName)
-
setFaultString
public void setFaultString(String faultString) throws SOAPException
Description copied from interface:SOAPFaultSets the fault string for thisSOAPFaultobject to the given string.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:addFaultReasonText(faultString, Locale.getDefault());- Parameters:
faultString- aStringgiving an explanation of the fault- Throws:
SOAPException- if there was an error in adding thefaultStringto the underlying XML tree.- See Also:
SOAPFault.getFaultString()
-
getFaultString
public String getFaultString()
Description copied from interface:SOAPFaultGets the fault string for thisSOAPFaultobject.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:String reason = null; try { reason = (String) getFaultReasonTexts().next(); } catch (SOAPException e) {} return reason;- Returns:
- a
Stringgiving an explanation of the fault - See Also:
SOAPFault.setFaultString(String),SOAPFault.setFaultString(String, Locale)
-
getFaultStringLocale
public Locale getFaultStringLocale()
Description copied from interface:SOAPFaultGets the locale of the fault string for thisSOAPFaultobject.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:Locale locale = null; try { locale = (Locale) getFaultReasonLocales().next(); } catch (SOAPException e) {} return locale;- Returns:
- a
Localeobject indicating the native language of the fault string ornullif no locale was specified - See Also:
SOAPFault.setFaultString(String, Locale)
-
setFaultString
public void setFaultString(String faultString, Locale locale) throws SOAPException
Description copied from interface:SOAPFaultSets the fault string for thisSOAPFaultobject to the given string and localized to the given locale.If this
SOAPFaultis part of a message that supports SOAP 1.2 then this call is equivalent to:addFaultReasonText(faultString, locale);- Parameters:
faultString- aStringgiving an explanation of the faultlocale- aLocaleobject indicating the native language of thefaultString- Throws:
SOAPException- if there was an error in adding thefaultStringto the underlying XML tree.- See Also:
SOAPFault.getFaultString()
-
isStandardFaultElement
protected boolean isStandardFaultElement(String localName)
- Specified by:
isStandardFaultElementin classFaultImpl
-
appendFaultSubcode
public void appendFaultSubcode(QName subcode)
Description copied from interface:SOAPFaultAdds a Subcode to the end of the sequence of Subcodes contained by thisSOAPFault. Subcodes, which were introduced in SOAP 1.2, are represented by a recursive sequence of subelements rooted in the mandatory Code subelement of a SOAP Fault.- Parameters:
subcode- a QName containing the Value of the Subcode.
-
removeAllFaultSubcodes
public void removeAllFaultSubcodes()
Description copied from interface:SOAPFaultRemoves any Subcodes that may be contained by thisSOAPFault. Subsequent calls togetFaultSubcodeswill return an empty iterator until a call toappendFaultSubcodeis made.
-
getFaultSubcodes
public Iterator<QName> getFaultSubcodes()
Description copied from interface:SOAPFaultGets the Subcodes for thisSOAPFaultas an iterator overQNames.- Returns:
- an
Iteratorthat accesses a sequence ofQNames. ThisIteratorshould not support the optionalremovemethod. The order in which the Subcodes are returned reflects the hierarchy of Subcodes present in the fault from top to bottom.
-
getFaultReasonText
public String getFaultReasonText(Locale locale)
Description copied from interface:SOAPFaultReturns the Reason Text associated with the givenLocale. If more than one such Reason Text exists the first matching Text is returned- Parameters:
locale- -- theLocalefor which a localized Reason Text is desired- Returns:
- the Reason Text associated with
locale - See Also:
SOAPFault.getFaultString()
-
getFaultReasonTexts
public Iterator<String> getFaultReasonTexts()
Description copied from interface:SOAPFaultReturns anIteratorover a sequence ofStringobjects containing all of the Reason Text items for thisSOAPFault.- Returns:
- an
Iteratorover env:Fault/env:Reason/env:Text items.
-
getFaultReasonLocales
public Iterator<Locale> getFaultReasonLocales()
Description copied from interface:SOAPFaultReturns anIteratorover a distinct sequence ofLocales for which there are associated Reason Text items. Any of theseLocales can be used in a call togetFaultReasonTextin order to obtain a localized version of the Reason Text string.- Returns:
- an
Iteratorover a sequence ofLocaleobjects for which there are associated Reason Text items.
-
addFaultReasonText
public void addFaultReasonText(String text, Locale locale) throws SOAPException
Description copied from interface:SOAPFaultAppends or replaces a Reason Text item containing the specified text message and an xml:lang derived fromlocale. If a Reason Text item with this xml:lang already exists its text value will be replaced withtext. Thelocaleparameter should not benullCode sample:
SOAPFault fault = ...; fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);- Parameters:
text- -- reason message stringlocale- -- Locale object representing the locale of the message- Throws:
SOAPException- if there was an error in adding the Reason text or thelocalepassed wasnull.
-
getFaultRole
public String getFaultRole()
Description copied from interface:SOAPFaultReturns the optional Role element value for thisSOAPFaultobject. The Role element is optional in SOAP 1.2.- Returns:
- Content of the env:Fault/env:Role element as a String
or
nullif none
-
setFaultRole
public void setFaultRole(String uri)
Description copied from interface:SOAPFaultCreates or replaces any existing Role element value for thisSOAPFaultobject. The Role element is optional in SOAP 1.2.- Parameters:
uri- the URI of the Role
-
getFaultNode
public String getFaultNode()
Description copied from interface:SOAPFaultReturns the optional Node element value for thisSOAPFaultobject. The Node element is optional in SOAP 1.2.- Returns:
- Content of the env:Fault/env:Node element as a String
or
nullif none
-
setFaultNode
public void setFaultNode(String uri)
Description copied from interface:SOAPFaultCreates or replaces any existing Node element value for thisSOAPFaultobject. The Node element is optional in SOAP 1.2.- Parameters:
uri- the URI of the Node
-
getDefaultFaultCode
protected QName getDefaultFaultCode()
- Specified by:
getDefaultFaultCodein classFaultImpl
-
addChildElement
public SOAPElement addChildElement(SOAPElement element) throws SOAPException
Description copied from interface:SOAPElementAdd aSOAPElementas a child of thisSOAPElementinstance. TheSOAPElementis expected to be created by aSOAPFactory. Callers should not rely on the element instance being added as is into the XML tree. Implementations could end up copying the content of theSOAPElementpassed into an instance of a differentSOAPElementimplementation. For instance ifaddChildElement()is called on aSOAPHeader,elementwill be copied into an instance of aSOAPHeaderElement.The fragment rooted in
elementis either added as a whole or not at all, if there was an error.The fragment rooted in
elementcannot contain elements named "Envelope", "Header" or "Body" and in the SOAP namespace. Any namespace prefixes present in the fragment should be fully resolved using appropriate namespace declarations within the fragment itself.- Specified by:
addChildElementin interfaceSOAPElement- Overrides:
addChildElementin classElementImpl- Parameters:
element- theSOAPElementto be added as a new child- Returns:
- an instance representing the new SOAP element that was actually added to the tree.
- Throws:
SOAPException- if there was an error in adding this element as a child
-
createSOAPFaultElement
protected FaultElementImpl createSOAPFaultElement(QName qname)
- Specified by:
createSOAPFaultElementin classFaultImpl
-
createSOAPFaultElement
protected FaultElementImpl createSOAPFaultElement(Name qname)
- Specified by:
createSOAPFaultElementin classFaultImpl
-
setFaultCode
public void setFaultCode(String faultCode, String prefix, String uri) throws SOAPException
- Overrides:
setFaultCodein classFaultImpl- Throws:
SOAPException
-
setFaultActor
public void setFaultActor(String faultActor) throws SOAPException
Description copied from interface:SOAPFaultSets thisSOAPFaultobject with the given fault actor.The fault actor is the recipient in the message path who caused the fault to happen.
If this
SOAPFaultsupports SOAP 1.2 then this call is equivalent toSOAPFault.setFaultRole(String)- Specified by:
setFaultActorin interfaceSOAPFault- Specified by:
setFaultActorin classFaultImpl- Parameters:
faultActor- aStringidentifying the actor that caused thisSOAPFaultobject- Throws:
SOAPException- if there was an error in adding thefaultActorto the underlying XML tree.- See Also:
SOAPFault.getFaultActor()
-
-