|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmpp.packet.PacketError
@NotThreadSafe public class PacketError
A packet error. Errors must have a type and condition. Optionally, they can include explanation text.
Nested Class Summary | |
---|---|
static class |
PacketError.Condition
Type-safe enumeration for the error condition. |
static class |
PacketError.Type
Error type. |
Constructor Summary | |
---|---|
PacketError(org.dom4j.Element element)
Constructs a new PacketError using an existing Element. |
|
PacketError(PacketError.Condition condition)
Construcs a new PacketError with the specified condition. |
|
PacketError(PacketError.Condition condition,
PacketError.Type type)
Constructs a new PacketError with the specified condition and type. |
|
PacketError(PacketError.Condition condition,
PacketError.Type type,
java.lang.String text)
Constructs a new PacketError. |
|
PacketError(PacketError.Condition condition,
PacketError.Type type,
java.lang.String text,
java.lang.String lang)
Constructs a new PacketError. |
Method Summary | |
---|---|
java.lang.String |
getApplicationConditionName()
Returns the name of the application-specific error condition, or null if there is no application-specific error. |
java.lang.String |
getApplicationConditionNamespaceURI()
Returns the namespace of the application-specific error condition, or null if there is no application-specific error. |
PacketError.Condition |
getCondition()
Returns the error condition. |
org.dom4j.Element |
getElement()
Returns the DOM4J Element that backs the error. |
java.lang.String |
getText()
Returns a text description of the error, or null if there is no text description. |
java.lang.String |
getTextLang()
Returns the text description's language code, or null if there is no language code associated with the description text. |
PacketError.Type |
getType()
Returns the error type. |
void |
setApplicationCondition(java.lang.String name)
Sets an application-specific error condition. |
void |
setApplicationCondition(java.lang.String name,
java.lang.String namespaceURI)
Sets an application-specific error condition. |
void |
setCondition(PacketError.Condition condition)
Sets the error condition. |
void |
setText(java.lang.String text)
Sets the text description of the error. |
void |
setText(java.lang.String text,
java.lang.String lang)
Sets the text description of the error. |
void |
setType(PacketError.Type type)
Sets the error type. |
java.lang.String |
toString()
|
java.lang.String |
toXML()
Returns the textual XML representation of this error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PacketError(PacketError.Condition condition)
condition
- the error condition.public PacketError(PacketError.Condition condition, PacketError.Type type)
condition
- the error condition.type
- the error type.public PacketError(PacketError.Condition condition, PacketError.Type type, java.lang.String text)
type
- the error type.condition
- the error condition.text
- the text description of the error.public PacketError(PacketError.Condition condition, PacketError.Type type, java.lang.String text, java.lang.String lang)
type
- the error type.condition
- the error condition.text
- the text description of the error.lang
- the language code of the error description (e.g. "en").public PacketError(org.dom4j.Element element)
element
- the error Element.Method Detail |
---|
public PacketError.Type getType()
PacketError.Type
public void setType(PacketError.Type type)
type
- the error type.PacketError.Type
public PacketError.Condition getCondition()
PacketError.Condition
public void setCondition(PacketError.Condition condition)
condition
- the error condition.PacketError.Condition
public java.lang.String getText()
public void setText(java.lang.String text)
text
- the text description of the error.public void setText(java.lang.String text, java.lang.String lang)
text
- the text description of the error.lang
- the language code of the description, or null to specify
no language code.public java.lang.String getTextLang()
public void setApplicationCondition(java.lang.String name)
name
- the name of the application-specific error condition.public void setApplicationCondition(java.lang.String name, java.lang.String namespaceURI)
name
- the name of the application-specific error condition.namespaceURI
- the namespace of the application.public java.lang.String getApplicationConditionName()
public java.lang.String getApplicationConditionNamespaceURI()
public org.dom4j.Element getElement()
public java.lang.String toXML()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |