Package org.jivesoftware.smack.packet
Class AbstractError
- java.lang.Object
-
- org.jivesoftware.smack.packet.AbstractError
-
- Direct Known Subclasses:
SaslNonza.SASLFailure
,StanzaError
,StreamError
public class AbstractError extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractError.Builder<B extends AbstractError.Builder<B>>
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>
descriptiveTexts
protected List<XmlElement>
extensions
protected String
textNamespace
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractError(Map<String,String> descriptiveTexts)
protected
AbstractError(Map<String,String> descriptiveTexts, String textNamespace, List<XmlElement> extensions)
protected
AbstractError(Map<String,String> descriptiveTexts, List<XmlElement> extensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addDescriptiveTextsAndExtensions(XmlStringBuilder xml)
String
getDescriptiveText()
Get the descriptive text of this SASLFailure.String
getDescriptiveText(String xmllang)
Get the descriptive test of this SASLFailure.<PE extends XmlElement>
PEgetExtension(String elementName, String namespace)
Returns the first stanza extension that matches the specified element name and namespace, ornull
if it doesn't exist.
-
-
-
Field Detail
-
textNamespace
protected final String textNamespace
-
descriptiveTexts
protected final Map<String,String> descriptiveTexts
-
extensions
protected final List<XmlElement> extensions
-
-
Constructor Detail
-
AbstractError
protected AbstractError(Map<String,String> descriptiveTexts)
-
AbstractError
protected AbstractError(Map<String,String> descriptiveTexts, List<XmlElement> extensions)
-
AbstractError
protected AbstractError(Map<String,String> descriptiveTexts, String textNamespace, List<XmlElement> extensions)
-
-
Method Detail
-
getDescriptiveText
public String getDescriptiveText()
Get the descriptive text of this SASLFailure.Returns the descriptive text of this SASLFailure in the system default language if possible. May return null.
- Returns:
- the descriptive text or null.
-
getDescriptiveText
public String getDescriptiveText(String xmllang)
Get the descriptive test of this SASLFailure.Returns the descriptive text of this SASLFailure in the given language. May return null if not available.
- Parameters:
xmllang
- the language.- Returns:
- the descriptive text or null.
-
getExtension
public <PE extends XmlElement> PE getExtension(String elementName, String namespace)
Returns the first stanza extension that matches the specified element name and namespace, ornull
if it doesn't exist.- Type Parameters:
PE
- type of the ExtensionElement.- Parameters:
elementName
- the XML element name of the stanza extension.namespace
- the XML element namespace of the stanza extension.- Returns:
- the extension, or
null
if it doesn't exist.
-
addDescriptiveTextsAndExtensions
protected void addDescriptiveTextsAndExtensions(XmlStringBuilder xml)
-
-