public class SOAPFaultImpl extends SOAPBodyElementDoc implements SOAPFault
Modifier and Type | Field and Description |
---|---|
static Set<QName> |
soap11FaultCodes |
static Set<QName> |
soap12FaultCodes |
GENERIC_PARAM_NAME, GENERIC_RETURN_NAME, soapContent
domNode, soapParent
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 and Description |
---|
SOAPFaultImpl() |
SOAPFaultImpl(SOAPElementImpl element) |
SOAPFaultImpl(String prefix,
String namespace) |
Modifier and Type | Method and Description |
---|---|
SOAPElement |
addChildElement(SOAPElement child)
Add a SOAPElement as a child of this SOAPElement instance.
|
Detail |
addDetail()
Creates an optional Detail object and sets it as the Detail object for this SOAPFault object.
|
void |
addFaultReasonText(String text,
Locale locale)
Appends or replaces a Reason Text item containing the specified
text message and an xml:lang derived from
locale . |
void |
appendFaultSubcode(QName subcode)
Adds a Subcode to the end of the sequence of Subcodes contained by this
SOAPFault . |
Detail |
getDetail()
Returns the optional detail element for this SOAPFault object.
|
String |
getFaultActor()
Gets the fault actor for this SOAPFault object.
|
String |
getFaultCode()
Gets the fault code for this SOAPFault object.
|
Name |
getFaultCodeAsName()
Gets the mandatory SOAP 1.1 fault code for this SOAPFault object as a SAAJ Name object.
|
QName |
getFaultCodeAsQName()
Gets the fault code for this
SOAPFault object as a QName object. |
String |
getFaultNode()
Returns the optional Node element value for this
SOAPFault object. |
Iterator |
getFaultReasonLocales()
Returns an
Iterator over a distinct sequence of
Locale s for which there are associated Reason Text items. |
String |
getFaultReasonText(Locale locale)
Returns the Reason Text associated with the given
Locale . |
Iterator |
getFaultReasonTexts()
Returns an
Iterator over a sequence of
String objects containing all of the Reason Text items for
this SOAPFault . |
String |
getFaultRole()
Returns the optional Role element value for this
SOAPFault object. |
String |
getFaultString()
Gets the fault string for this SOAPFault object.
|
Locale |
getFaultStringLocale()
Gets the locale of the fault string for this SOAPFault object.
|
Iterator |
getFaultSubcodes()
Gets the Subcodes for this
SOAPFault as an iterator over
QNames . |
boolean |
hasDetail()
Returns true if this
SOAPFault has a Detail
subelement and false otherwise. |
void |
removeAllFaultSubcodes()
Removes any Subcodes that may be contained by this
SOAPFault . |
void |
setFaultActor(String faultActor)
Sets this SOAPFault object with the given fault actor.
|
void |
setFaultCode(Name faultCode)
Sets this SOAPFault object with the given fault code.
|
void |
setFaultCode(QName faultCode)
Sets this
SOAPFault object with the given fault code. |
void |
setFaultCode(String faultCode)
Sets this SOAPFault object with the give fault code.
|
void |
setFaultNode(String uri)
Creates or replaces any existing Node element value for
this
SOAPFault object. |
void |
setFaultRole(String uri)
Creates or replaces any existing Role element value for
this
SOAPFault object. |
void |
setFaultString(String faultString)
Sets the fault string for this SOAPFault object to the given string.
|
void |
setFaultString(String faultString,
Locale locale)
Sets the fault string for this SOAPFault object to the given string and localized to the given locale.
|
void |
writeElement(Writer writer)
The default implementation uses a DOMWriter.
|
transitionTo
accept, addAttribute, addChildElement, addChildElement, addChildElement, addChildElement, addNamespaceDeclaration, addTextNode, appendChild, cloneNode, getAllAttributes, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getAttributeValue, getChildElements, getChildElements, getChildNodes, getElementName, getElementsByTagName, getElementsByTagNameNS, getEncodingStyle, getFirstChild, getJavaType, getLastChild, getNamespacePrefixes, getNamespaceURI, getNextSibling, getObjectValue, getParamMetaData, getPreviousSibling, getSchemaTypeInfo, getTagName, getValue, getVisibleNamespacePrefixes, getXMLFragment, getXmlType, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, removeAttribute, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeContents, removeNamespaceDeclaration, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setObjectValue, setParamMetaData, setValue, setXMLFragment
addAttribute, addChildElement, createQName, getAllAttributesAsQNames, getAttributeValue, getChildElements, getElementQName, getFirstChildElementByLocalName, getSOAPEnvelope, removeAttribute, setElementQName, setElementQNameInternal, setEncodingStyle, setPrefix, writeElementContent
compareDocumentPosition, detachNode, getBaseURI, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getTextContent, getUserData, hashCode, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, setNodeValue, setParentElement, setTextContent, setUserData, toString
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
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, setElementQName, setEncodingStyle
detachNode, getParentElement, getValue, recycleNode, setParentElement, setValue
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
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
public SOAPFaultImpl() throws SOAPException
SOAPException
public SOAPFaultImpl(String prefix, String namespace) throws SOAPException
SOAPException
public SOAPFaultImpl(SOAPElementImpl element)
public String getFaultCode()
getFaultCode
in interface SOAPFault
String
with the fault codeSOAPFault.getFaultCodeAsName()
,
SOAPFault.setFaultCode(javax.xml.soap.Name)
public Name getFaultCodeAsName()
getFaultCodeAsName
in interface SOAPFault
Name
representing the faultcodeSOAPFault.setFaultCode(Name)
public QName getFaultCodeAsQName()
SOAPFault
SOAPFault
object as a QName
object.getFaultCodeAsQName
in interface SOAPFault
QName
representing the faultcodeSOAPFault.setFaultCode(QName)
public void setFaultCode(String faultCode) throws SOAPException
setFaultCode
in interface SOAPFault
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.SOAPException
- if there was an error in adding the
faultCode
to the underlying XML tree.SOAPFault.setFaultCode(Name)
,
SOAPFault.getFaultCode()
,
SOAPElement.addNamespaceDeclaration(java.lang.String, java.lang.String)
public void setFaultCode(Name faultCode) throws SOAPException
setFaultCode
in interface SOAPFault
faultCode
- a Name
object giving the fault
code to be set. It must be namespace qualified.SOAPException
- if there was an error in adding the
faultcode element to the underlying XML tree.SOAPFault.getFaultCodeAsName()
public void setFaultCode(QName faultCode) throws SOAPException
SOAPFault
SOAPFault
object with the given fault code.
It is preferable to use this method over SOAPFault.setFaultCode(Name)
.setFaultCode
in interface SOAPFault
faultCode
- a QName
object giving the fault
code to be set. It must be namespace qualified.SOAPException
- if there was an error in adding the
faultcode
element to the underlying XML tree.SOAPFault.getFaultCodeAsQName()
,
SOAPFault.setFaultCode(Name)
,
SOAPFault.getFaultCodeAsQName()
public Iterator getFaultSubcodes()
SOAPFault
SOAPFault
as an iterator over
QNames
.getFaultSubcodes
in interface SOAPFault
Iterator
that accesses a sequence of
QNames
. This Iterator
should not support
the optional remove
method. The order in which the
Subcodes are returned reflects the hierarchy of Subcodes present
in the fault from top to bottom.public void appendFaultSubcode(QName subcode) throws SOAPException
SOAPFault
SOAPFault
. 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.appendFaultSubcode
in interface SOAPFault
subcode
- a QName containing the Value of the Subcode.SOAPException
- if there was an error in setting the Subcodepublic void removeAllFaultSubcodes()
SOAPFault
SOAPFault
. Subsequent calls to
getFaultSubcodes
will return an empty iterator until a call
to appendFaultSubcode
is made.removeAllFaultSubcodes
in interface SOAPFault
public String getFaultString()
getFaultString
in interface SOAPFault
String
giving an explanation of
the faultSOAPFault.setFaultString(String)
,
SOAPFault.setFaultString(String, Locale)
public Locale getFaultStringLocale()
getFaultStringLocale
in interface SOAPFault
Locale
object indicating the native language of
the fault string or null
if no locale was specifiedSOAPFault.setFaultString(String, Locale)
public void setFaultString(String faultString) throws SOAPException
setFaultString
in interface SOAPFault
faultString
- a String
giving an explanation of
the faultSOAPException
- if there was an error in adding the
faultString
to the underlying XML tree.SOAPFault.getFaultString()
public void setFaultString(String faultString, Locale locale) throws SOAPException
setFaultString
in interface SOAPFault
faultString
- a String
giving an explanation of
the faultlocale
- a Locale
object indicating
the native language of the faultString
SOAPException
- if there was an error in adding the
faultString
to the underlying XML tree.SOAPFault.getFaultString()
public Iterator getFaultReasonTexts() throws SOAPException
SOAPFault
Iterator
over a sequence of
String
objects containing all of the Reason Text items for
this SOAPFault
.getFaultReasonTexts
in interface SOAPFault
Iterator
over env:Fault/env:Reason/env:Text items.SOAPException
- if there was an error in retrieving
the fault Reason texts.public Iterator getFaultReasonLocales() throws SOAPException
SOAPFault
Iterator
over a distinct sequence of
Locale
s for which there are associated Reason Text items.
Any of these Locale
s can be used in a call to
getFaultReasonText
in order to obtain a localized version
of the Reason Text string.getFaultReasonLocales
in interface SOAPFault
Iterator
over a sequence of Locale
objects for which there are associated Reason Text items.SOAPException
- if there was an error in retrieving
the fault Reason locales.public String getFaultReasonText(Locale locale) throws SOAPException
SOAPFault
Locale
.
If more than one such Reason Text exists the first matching Text is
returnedgetFaultReasonText
in interface SOAPFault
locale
- -- the Locale
for which a localized
Reason Text is desiredlocale
SOAPException
- if there was an error in retrieving
the fault Reason text for the specified locale .SOAPFault.getFaultString()
public void addFaultReasonText(String text, Locale locale) throws SOAPException
SOAPFault
locale
. If a Reason Text item with this
xml:lang already exists its text value will be replaced
with text
.
The locale
parameter should not be null
Code sample:
SOAPFault fault = ...; fault.addFaultReasonText("Version Mismatch", Locale.ENGLISH);
addFaultReasonText
in interface SOAPFault
text
- -- reason message stringlocale
- -- Locale object representing the locale of the messageSOAPException
- if there was an error in adding the Reason text
or the locale
passed was null
.public String getFaultActor()
getFaultActor
in interface SOAPFault
String
giving the actor in the message path
that caused this SOAPFault
objectSOAPFault.setFaultActor(java.lang.String)
public void setFaultActor(String faultActor) throws SOAPException
setFaultActor
in interface SOAPFault
faultActor
- a String
identifying the actor that
caused this SOAPFault
objectSOAPException
- if there was an error in adding the
faultActor
to the underlying XML tree.SOAPFault.getFaultActor()
public String getFaultRole()
SOAPFault
SOAPFault
object. The Role element is
optional in SOAP 1.2.getFaultRole
in interface SOAPFault
null
if nonepublic void setFaultRole(String uri) throws SOAPException
SOAPFault
SOAPFault
object. The Role element
is optional in SOAP 1.2.setFaultRole
in interface SOAPFault
uri
- - the URI of the RoleSOAPException
- if there was an error in setting the
Role for this SOAPFault
object.public String getFaultNode()
SOAPFault
SOAPFault
object. The Node element is
optional in SOAP 1.2.getFaultNode
in interface SOAPFault
null
if nonepublic void setFaultNode(String uri) throws SOAPException
SOAPFault
SOAPFault
object. The Node element
is optional in SOAP 1.2.setFaultNode
in interface SOAPFault
SOAPException
- if there was an error in setting the
Node for this SOAPFault
object.public boolean hasDetail()
SOAPFault
SOAPFault
has a Detail
subelement and false otherwise. Equivalent to
(getDetail()!=null)
.public Detail getDetail()
public Detail addDetail() throws SOAPException
addDetail
in interface SOAPFault
Detail
objectSOAPException
- if this
SOAPFault
object already contains a
valid Detail
objectpublic SOAPElement addChildElement(SOAPElement child) throws SOAPException
SOAPElementImpl
addChildElement
in interface SOAPElement
addChildElement
in class SOAPContentElement
child
- the SOAPElement to be added as a new childSOAPException
- if there was an error in adding this
element as a childpublic void writeElement(Writer writer)
SOAPElementImpl
writeElement
in class SOAPContentElement
Copyright © 2018 JBoss by Red Hat. All rights reserved.