public final class StanzaError extends Object
<error/> element.
See 8.3.2. Syntax
| 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,
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.
|
| Modifier and Type | Method and Description |
|---|---|
Jid |
getBy()
Gets the 'by' attribute.
|
Condition |
getCondition()
Gets the defined error condition.
|
Object |
getExtension()
Gets the application specific condition, if any.
|
String |
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'.
|
void |
setBy(Jid by)
Sets the 'by' attribute.
|
void |
setExtension(Object extension)
Sets an application specific condition.
|
void |
setText(String text)
Sets the optional error text.
|
void |
setText(String text,
String language)
Sets the optional error text and a language.
|
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 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.
setBy(rocks.xmpp.core.Jid)public void setBy(Jid by)
by - The JID.getBy()public StanzaError.Type getType()
public String getText()
setText(String)public void setText(String text)
text - The text.setText(String, String),
getText()public void setText(String text, String language)
text - The text.language - The language.setText(String),
getText()public String getLanguage()
setText(String, String)public 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.
setExtension(Object)public void setExtension(Object extension)
extension - The application specific condition.getExtension()public Condition getCondition()
Copyright © 2014 XMPP.rocks. All rights reserved.