@NotThreadSafe public class PacketError extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PacketError.Condition
Type-safe enumeration for the error condition.
|
static class |
PacketError.Type
Error type.
|
| Constructor and Description |
|---|
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,
String text)
Constructs a new PacketError.
|
PacketError(PacketError.Condition condition,
PacketError.Type type,
String text,
String lang)
Constructs a new PacketError.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getApplicationConditionName()
Returns the name of the application-specific error condition,
or
null if there is no application-specific error. |
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.
|
String |
getText()
Returns a text description of the error, or
null if there
is no text description. |
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(String name)
Sets an application-specific error condition.
|
void |
setApplicationCondition(String name,
String namespaceURI)
Sets an application-specific error condition.
|
void |
setCondition(PacketError.Condition condition)
Sets the error condition.
|
void |
setText(String text)
Sets the text description of the error.
|
void |
setText(String text,
String lang)
Sets the text description of the error.
|
void |
setType(PacketError.Type type)
Sets the error type.
|
String |
toString() |
String |
toXML()
Returns the textual XML representation of this error.
|
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, 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, String text, 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.public PacketError.Type getType()
PacketError.Typepublic void setType(PacketError.Type type)
type - the error type.PacketError.Typepublic PacketError.Condition getCondition()
PacketError.Conditionpublic void setCondition(PacketError.Condition condition)
condition - the error condition.PacketError.Conditionpublic String getText()
null if there
is no text description.public void setText(String text)
text - the text description of the error.public void setText(String text, String lang)
text - the text description of the error.lang - the language code of the description, or null to specify
no language code.public String getTextLang()
null if there
is no language code associated with the description text.public void setApplicationCondition(String name)
name - the name of the application-specific error condition.public void setApplicationCondition(String name, String namespaceURI)
name - the name of the application-specific error condition.namespaceURI - the namespace of the application.public String getApplicationConditionName()
null if there is no application-specific error.public String getApplicationConditionNamespaceURI()
null if there is no application-specific error.public org.dom4j.Element getElement()
public String toXML()
Copyright © 2009–2021 Ignite Realtime. All rights reserved.