public class Fault1_1Impl extends FaultImpl
Modifier and Type | Field and Description |
---|---|
protected static Logger |
log |
detail, faultActorElement, faultCodeElement, faultStringElement
DSIG_NS, elementQName, WSU_NS, XENC_NS, XML_URI, XMLNS_URI
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 |
---|
Fault1_1Impl(SOAPDocumentImpl ownerDoc) |
Fault1_1Impl(SOAPDocumentImpl ownerDoc,
Element domElement) |
Fault1_1Impl(SOAPDocumentImpl ownerDocument,
String prefix) |
Modifier and Type | Method and Description |
---|---|
SOAPElement |
addChildElement(SOAPElement element)
Add a
SOAPElement as a child of this
SOAPElement instance. |
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 . |
protected void |
checkIfStandardFaultCode(String faultCode,
String uri) |
protected DetailImpl |
createDetail() |
protected FaultElementImpl |
createSOAPFaultElement(Name qname) |
protected FaultElementImpl |
createSOAPFaultElement(QName qname) |
protected FaultElementImpl |
createSOAPFaultElement(String localName) |
protected void |
finallySetFaultCode(String faultcode) |
protected QName |
getDefaultFaultCode() |
protected NameImpl |
getDetailName() |
protected NameImpl |
getFaultActorName() |
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. |
protected NameImpl |
getFaultCodeName() |
String |
getFaultNode()
Returns the optional Node element value for this
SOAPFault object. |
Iterator<Locale> |
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<String> |
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. |
protected NameImpl |
getFaultStringName() |
Iterator<QName> |
getFaultSubcodes()
Gets the Subcodes for this
SOAPFault as an iterator over
QNames . |
protected boolean |
isStandardFaultElement(String localName) |
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(String faultCode,
String prefix,
String uri) |
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. |
addDetail, addElement, addElement, addFaultCodeElement, addSOAPFaultElement, convertCodeToQName, convertToSoapElement, findFaultActorElement, findFaultCodeElement, findFaultStringElement, getDetail, getFaultActor, hasDetail, initializeDetail, localeToXmlLang, setElementQName, setFaultCode, setFaultCode, setFaultCode, xmlLangToLocale
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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, 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
protected static final Logger log
public Fault1_1Impl(SOAPDocumentImpl ownerDocument, String prefix)
public Fault1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement)
public Fault1_1Impl(SOAPDocumentImpl ownerDoc)
protected NameImpl getDetailName()
getDetailName
in class FaultImpl
protected NameImpl getFaultCodeName()
getFaultCodeName
in class FaultImpl
protected NameImpl getFaultStringName()
getFaultStringName
in class FaultImpl
protected NameImpl getFaultActorName()
getFaultActorName
in class FaultImpl
protected DetailImpl createDetail()
createDetail
in class FaultImpl
protected FaultElementImpl createSOAPFaultElement(String localName)
createSOAPFaultElement
in class FaultImpl
protected void checkIfStandardFaultCode(String faultCode, String uri) throws SOAPException
checkIfStandardFaultCode
in class FaultImpl
SOAPException
protected void finallySetFaultCode(String faultcode) throws SOAPException
finallySetFaultCode
in class FaultImpl
SOAPException
public String getFaultCode()
SOAPFault
SOAPFault
object.String
with the fault codeSOAPFault.getFaultCodeAsName()
,
SOAPFault.setFaultCode(javax.xml.soap.Name)
public Name getFaultCodeAsName()
SOAPFault
SOAPFault
object as a SAAJ Name
object.
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 the getFaultCode
method since
it allows applications to easily access the namespace name without
additional parsing.Name
representing the faultcodeSOAPFault.setFaultCode(Name)
public QName getFaultCodeAsQName()
SOAPFault
SOAPFault
object as a QName
object.QName
representing the faultcodeSOAPFault.setFaultCode(QName)
public void setFaultString(String faultString) throws SOAPException
SOAPFault
SOAPFault
object
to the given string.
If this
SOAPFault
is part of a message that supports SOAP 1.2 then
this call is equivalent to:
addFaultReasonText(faultString, Locale.getDefault());
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 String getFaultString()
SOAPFault
SOAPFault
object.
If this
SOAPFault
is 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;
String
giving an explanation of
the faultSOAPFault.setFaultString(String)
,
SOAPFault.setFaultString(String, Locale)
public Locale getFaultStringLocale()
SOAPFault
SOAPFault
object.
If this
SOAPFault
is 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;
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, Locale locale) throws SOAPException
SOAPFault
SOAPFault
object
to the given string and localized to the given locale.
If this
SOAPFault
is part of a message that supports SOAP 1.2 then
this call is equivalent to:
addFaultReasonText(faultString, locale);
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()
protected boolean isStandardFaultElement(String localName)
isStandardFaultElement
in class FaultImpl
public void appendFaultSubcode(QName subcode)
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.subcode
- a QName containing the Value of the Subcode.public void removeAllFaultSubcodes()
SOAPFault
SOAPFault
. Subsequent calls to
getFaultSubcodes
will return an empty iterator until a call
to appendFaultSubcode
is made.public Iterator<QName> getFaultSubcodes()
SOAPFault
SOAPFault
as an iterator over
QNames
.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 String getFaultReasonText(Locale locale)
SOAPFault
Locale
.
If more than one such Reason Text exists the first matching Text is
returnedlocale
- -- the Locale
for which a localized
Reason Text is desiredlocale
SOAPFault.getFaultString()
public Iterator<String> getFaultReasonTexts()
SOAPFault
Iterator
over a sequence of
String
objects containing all of the Reason Text items for
this SOAPFault
.Iterator
over env:Fault/env:Reason/env:Text items.public Iterator<Locale> getFaultReasonLocales()
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.Iterator
over a sequence of Locale
objects for which there are associated Reason Text items.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);
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 getFaultRole()
SOAPFault
SOAPFault
object. The Role element is
optional in SOAP 1.2.null
if nonepublic void setFaultRole(String uri)
SOAPFault
SOAPFault
object. The Role element
is optional in SOAP 1.2.uri
- - the URI of the Rolepublic String getFaultNode()
SOAPFault
SOAPFault
object. The Node element is
optional in SOAP 1.2.null
if nonepublic void setFaultNode(String uri)
SOAPFault
SOAPFault
object. The Node element
is optional in SOAP 1.2.protected QName getDefaultFaultCode()
getDefaultFaultCode
in class FaultImpl
public SOAPElement addChildElement(SOAPElement element) throws SOAPException
SOAPElement
SOAPElement
as a child of this
SOAPElement
instance. The SOAPElement
is expected to be created by a
SOAPFactory
. Callers should not rely on the
element instance being added as is into the XML
tree. Implementations could end up copying the content
of the SOAPElement
passed into an instance of
a different SOAPElement
implementation. For
instance if addChildElement()
is called on a
SOAPHeader
, element
will be copied
into an instance of a SOAPHeaderElement
.
The fragment rooted in element
is either added
as a whole or not at all, if there was an error.
The fragment rooted in element
cannot 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.
addChildElement
in interface SOAPElement
addChildElement
in class ElementImpl
element
- the SOAPElement
to be added as a
new childSOAPException
- if there was an error in adding this
element as a childprotected FaultElementImpl createSOAPFaultElement(QName qname)
createSOAPFaultElement
in class FaultImpl
protected FaultElementImpl createSOAPFaultElement(Name qname)
createSOAPFaultElement
in class FaultImpl
public void setFaultCode(String faultCode, String prefix, String uri) throws SOAPException
setFaultCode
in class FaultImpl
SOAPException
public void setFaultActor(String faultActor) throws SOAPException
SOAPFault
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)
setFaultActor
in interface SOAPFault
setFaultActor
in class FaultImpl
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()
Copyright © 2019 JBoss by Red Hat. All rights reserved.