Class Fault1_2Impl
- 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_2.Fault1_2Impl
-
- All Implemented Interfaces:
Node,SOAPBodyElement,SOAPElement,SOAPFault,Element,Node
public class Fault1_2Impl 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_2Impl(SOAPDocumentImpl ownerDocument)Fault1_2Impl(SOAPDocumentImpl ownerDocument, String prefix)Fault1_2Impl(SOAPDocumentImpl ownerDoc, String name, String prefix)Fault1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SOAPElementaddAttribute(Name name, String value)Adds an attribute with the specified name and value to thisSOAPElementobject.SOAPElementaddAttribute(QName name, String value)Adds an attribute with the specified name and value to thisSOAPElementobject.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.SOAPElementaddTextNode(String text)Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.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.voidsetEncodingStyle(String encodingStyle)Sets the encoding style for thisSOAPElementobject to one specified.voidsetFaultActor(String faultActor)Sets thisSOAPFaultobject with the given fault actor.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, setFaultCode, xmlLangToLocale
-
Methods inherited from class com.sun.xml.messaging.saaj.soap.impl.ElementImpl
addCDATA, addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addNode, addText, 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, 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
addChildElement, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, createQName, getAllAttributes, getAllAttributesAsQNames, getAttributeValue, getAttributeValue, getChildElements, getChildElements, getChildElements, getElementName, getElementQName, getEncodingStyle, getNamespacePrefixes, getNamespaceURI, getVisibleNamespacePrefixes, removeAttribute, removeAttribute, removeContents, removeNamespaceDeclaration
-
-
-
-
Constructor Detail
-
Fault1_2Impl
public Fault1_2Impl(SOAPDocumentImpl ownerDoc, String name, String prefix)
-
Fault1_2Impl
public Fault1_2Impl(SOAPDocumentImpl ownerDocument, String prefix)
-
Fault1_2Impl
public Fault1_2Impl(SOAPDocumentImpl ownerDocument)
-
Fault1_2Impl
public Fault1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement)
-
-
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
-
getFaultReasonTexts
public Iterator<String> getFaultReasonTexts() throws SOAPException
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. - Throws:
SOAPException- if there was an error in retrieving the fault Reason texts.
-
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.
-
getFaultReasonText
public String getFaultReasonText(Locale locale) throws SOAPException
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 - Throws:
SOAPException- if there was an error in retrieving the fault Reason text for the specified locale .- See Also:
SOAPFault.getFaultString()
-
getFaultReasonLocales
public Iterator<Locale> getFaultReasonLocales() throws SOAPException
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. - Throws:
SOAPException- if there was an error in retrieving the fault Reason locales.
-
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)
-
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) throws SOAPException
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- Throws:
SOAPException- if there was an error in setting the Node for thisSOAPFaultobject.
-
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) throws SOAPException
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- Throws:
SOAPException- if there was an error in setting the Role for thisSOAPFaultobject.
-
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)
-
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)
-
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)
-
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)
-
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()
-
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()
-
appendFaultSubcode
public void appendFaultSubcode(QName subcode) throws SOAPException
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.- Throws:
SOAPException- if there was an error in setting 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.
-
setEncodingStyle
public void setEncodingStyle(String encodingStyle) throws SOAPException
Description copied from interface:SOAPElementSets the encoding style for thisSOAPElementobject to one specified.- Specified by:
setEncodingStylein interfaceSOAPElement- Overrides:
setEncodingStylein classElementImpl- Parameters:
encodingStyle- aStringgiving the encoding style- Throws:
SOAPException- if setting the encodingStyle is invalid for this SOAPElement.- See Also:
SOAPElement.getEncodingStyle()
-
addAttribute
public SOAPElement addAttribute(Name name, String value) throws SOAPException
Description copied from interface:SOAPElementAdds an attribute with the specified name and value to thisSOAPElementobject.- Specified by:
addAttributein interfaceSOAPElement- Overrides:
addAttributein classElementImpl- Parameters:
name- aNameobject with the name of the attributevalue- aStringgiving the value of the attribute- Returns:
- the
SOAPElementobject into which the attribute was inserted - Throws:
SOAPException- if there is an error in creating the Attribute, or it is invalid to set an attribute withNamenameon this SOAPElement.- See Also:
SOAPElement.addAttribute(javax.xml.namespace.QName, String)
-
addAttribute
public SOAPElement addAttribute(QName name, String value) throws SOAPException
Description copied from interface:SOAPElementAdds an attribute with the specified name and value to thisSOAPElementobject.- Specified by:
addAttributein interfaceSOAPElement- Overrides:
addAttributein classElementImpl- Parameters:
name- aQNameobject with the name of the attributevalue- aStringgiving the value of the attribute- Returns:
- the
SOAPElementobject into which the attribute was inserted - Throws:
SOAPException- if there is an error in creating the Attribute, or it is invalid to set an attribute withQNameqnameon this SOAPElement.- See Also:
SOAPElement.addAttribute(Name, String)
-
addTextNode
public SOAPElement addTextNode(String text) throws SOAPException
Description copied from interface:SOAPElementCreates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.- Specified by:
addTextNodein interfaceSOAPElement- Overrides:
addTextNodein classElementImpl- 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 or if it is not legal to attach it as a child to thisSOAPElement
-
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
-
isStandardFaultElement
protected boolean isStandardFaultElement(String localName)
- Specified by:
isStandardFaultElementin classFaultImpl
-
getDefaultFaultCode
protected QName getDefaultFaultCode()
- Specified by:
getDefaultFaultCodein classFaultImpl
-
createSOAPFaultElement
protected FaultElementImpl createSOAPFaultElement(QName qname)
- Specified by:
createSOAPFaultElementin classFaultImpl
-
createSOAPFaultElement
protected FaultElementImpl createSOAPFaultElement(Name qname)
- Specified by:
createSOAPFaultElementin classFaultImpl
-
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()
-
-