| java.lang.Object org.xmpp.packet.PacketError
PacketError | public class PacketError (Code) | | A packet error. Errors must have a type and condition. Optionally, they
can include explanation text.
author: Matt Tucker |
Inner Class :public enum Condition | |
Inner Class :public enum Type | |
Constructor Summary | |
public | PacketError(Condition condition) Construcs a new PacketError with the specified condition. | public | PacketError(Condition condition, Type type) Constructs a new PacketError with the specified condition and type. | public | PacketError(Condition condition, Type type, String text) Constructs a new PacketError. | public | PacketError(Condition condition, Type type, String text, String lang) Constructs a new PacketError.
Parameters: type - the error type. Parameters: condition - the error condition. Parameters: text - the text description of the error. Parameters: lang - the language code of the error description (e.g. | public | PacketError(Element element) Constructs a new PacketError using an existing Element. |
Method Summary | |
public Condition | getCondition() Returns the error condition. | public Element | getElement() Returns the DOM4J Element that backs the error. | public String | getText() Returns a text description of the error, or null if there
is no text description. | public String | getTextLang() Returns the text description's language code, or null if there
is no language code associated with the description text. | public Type | getType() Returns the error type. | public void | setCondition(Condition condition) Sets the error condition. | public void | setText(String text) Sets the text description of the error. | public void | setText(String text, String lang) Sets the text description of the error. | public void | setType(Type type) Sets the error type. | public String | toString() | public String | toXML() Returns the textual XML representation of this error. |
PacketError | public PacketError(Condition condition)(Code) | | Construcs a new PacketError with the specified condition. The error
type will be set to the default for the specified condition.
Parameters: condition - the error condition. |
PacketError | public PacketError(Condition condition, Type type)(Code) | | Constructs a new PacketError with the specified condition and type.
Parameters: condition - the error condition. Parameters: type - the error type. |
PacketError | public PacketError(Condition condition, Type type, String text)(Code) | | Constructs a new PacketError.
Parameters: type - the error type. Parameters: condition - the error condition. Parameters: text - the text description of the error. |
PacketError | public PacketError(Condition condition, Type type, String text, String lang)(Code) | | Constructs a new PacketError.
Parameters: type - the error type. Parameters: condition - the error condition. Parameters: text - the text description of the error. Parameters: lang - the language code of the error description (e.g. "en"). |
PacketError | public PacketError(Element element)(Code) | | Constructs a new PacketError using an existing Element. This is useful
for parsing incoming error Elements into PacketError objects.
Parameters: element - the error Element. |
getCondition | public Condition getCondition()(Code) | | Returns the error condition.
the error condition. See Also: Condition |
getElement | public Element getElement()(Code) | | Returns the DOM4J Element that backs the error. The element is the definitive
representation of the error and can be manipulated directly to change
error contents.
the DOM4J Element. |
getText | public String getText()(Code) | | Returns a text description of the error, or null if there
is no text description.
the text description of the error. |
getTextLang | public String getTextLang()(Code) | | Returns the text description's language code, or null if there
is no language code associated with the description text.
the language code of the text description, if it exists. |
getType | public Type getType()(Code) | | Returns the error type.
the error type. See Also: Type |
setCondition | public void setCondition(Condition condition)(Code) | | Sets the error condition.
Parameters: condition - the error condition. See Also: Condition |
setText | public void setText(String text)(Code) | | Sets the text description of the error.
Parameters: text - the text description of the error. |
setText | public void setText(String text, String lang)(Code) | | Sets the text description of the error. Optionally, a language code
can be specified to indicate the language of the description.
Parameters: text - the text description of the error. Parameters: lang - the language code of the description, or null to specifyno language code. |
setType | public void setType(Type type)(Code) | | Sets the error type.
Parameters: type - the error type. See Also: Type |
toXML | public String toXML()(Code) | | Returns the textual XML representation of this error.
the textual XML representation of this error. |
|
|