public final class StanzaError extends Object
<error/> element.
This class is immutable.
| Modifier and Type | Class and Description |
|---|---|
static class |
StanzaError.Type
Represents a
<error/> 'type' attribute. |
| Constructor and Description |
|---|
StanzaError(Condition condition)
Creates an error with a given condition.
|
StanzaError(Condition condition,
Object extension)
Creates an error with a given condition and extension.
|
StanzaError(Condition condition,
String text)
Creates an error with a given condition and text.
|
StanzaError(StanzaError.Type type,
Condition condition)
Creates an error with a given error type and a condition.
|
StanzaError(StanzaError.Type type,
Condition condition,
String text)
Creates an error with a given error type and a condition.
|
StanzaError(StanzaError.Type type,
Condition condition,
String text,
Locale language,
Object extension,
Jid by)
Creates a stanza error with all possible values.
|
| Modifier and Type | Method and Description |
|---|---|
Jid |
getBy()
Gets the 'by' attribute.
|
Condition |
getCondition()
Gets the defined error condition or
Condition.UNDEFINED_CONDITION if the condition is unknown. |
Object |
getExtension()
Gets the application specific condition, if any.
|
Locale |
getLanguage()
Gets the language of the error text.
|
String |
getText()
Gets the optional error text.
|
StanzaError.Type |
getType()
Gets the error type, either 'auth', 'cancel', 'continue', 'modify' or 'wait'.
|
String |
toString() |
public StanzaError(StanzaError.Type type, Condition condition)
The
<error/>element MUST contain a defined condition element.
type - The error type.condition - The condition.public StanzaError(StanzaError.Type type, Condition condition, String text)
The
<error/>element MUST contain a defined condition element.
type - The error type.condition - The condition.text - The text.public StanzaError(Condition condition)
The error type is set by the condition's associated error type.
condition - The condition.public StanzaError(Condition condition, String text)
The error type is set by the condition's associated error type.
condition - The condition.text - The text.public StanzaError(Condition condition, Object extension)
The error type is set by the condition's associated error type.
condition - The condition.extension - The extension.public StanzaError(StanzaError.Type type, Condition condition, String text, Locale language, Object extension, Jid by)
type - The error type.condition - The condition.text - The text.language - The language.extension - The application specific condition.by - The entity which returns the error.public final Jid getBy()
The entity that returns an error stanza MAY pass along its JID to the sender of the generated stanza (e.g., for diagnostic or tracking purposes) through the addition of a 'by' attribute to the <error/> child element.
public final StanzaError.Type getType()
public final String getText()
public final Locale getLanguage()
public final Object getExtension()
8.3.4. Application-Specific Conditions
As noted, an application MAY provide application-specific stanza error information by including a properly namespaced child within the error element. Typically, the application-specific element supplements or further qualifies a defined element. Thus, the
<error/>element will contain two or three child elements.
public final Condition getCondition()
Condition.UNDEFINED_CONDITION if the condition is unknown.Copyright © 2014–2018 XMPP.rocks. All rights reserved.