Stanza instead@Deprecated public interface Packet extends TopLevelStreamElement
| Modifier and Type | Field and Description |
|---|---|
static String |
ITEM
Deprecated.
|
static String |
TEXT
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(ExtensionElement extension)
Deprecated.
Adds a stanza(/packet) extension to the packet.
|
void |
addExtensions(Collection<ExtensionElement> extensions)
Deprecated.
Adds a collection of stanza(/packet) extensions to the packet.
|
XMPPError |
getError()
Deprecated.
Returns the error associated with this packet, or null if there are
no errors.
|
ExtensionElement |
getExtension(String namespace)
Deprecated.
Returns the first extension of this stanza(/packet) that has the given namespace.
|
<PE extends ExtensionElement> |
getExtension(String elementName,
String namespace)
Deprecated.
Returns the first stanza(/packet) extension that matches the specified element name and
namespace, or null if it doesn't exist.
|
List<ExtensionElement> |
getExtensions()
Deprecated.
Returns a copy of the stanza(/packet) extensions attached to the packet.
|
Set<ExtensionElement> |
getExtensions(String elementName,
String namespace)
Deprecated.
Return a set of all extensions with the given element name
|
String |
getFrom()
Deprecated.
Returns who the stanza(/packet) is being sent "from" or null if
the value is not set.
|
String |
getLanguage()
Deprecated.
Returns the xml:lang of this Stanza, or null if one has not been set.
|
String |
getPacketID()
Deprecated.
use
getStanzaId() instead. |
String |
getStanzaId()
Deprecated.
Returns the unique ID of the stanza.
|
String |
getTo()
Deprecated.
Returns who the stanza(/packet) is being sent "to", or null if
the value is not set.
|
boolean |
hasExtension(String namespace)
Deprecated.
Check if a stanza(/packet) extension with the given namespace exists.
|
boolean |
hasExtension(String elementName,
String namespace)
Deprecated.
Check if a stanza(/packet) extension with the given element and namespace exists.
|
ExtensionElement |
removeExtension(ExtensionElement extension)
Deprecated.
Removes a stanza(/packet) extension from the packet.
|
ExtensionElement |
removeExtension(String elementName,
String namespace)
Deprecated.
Remove the stanza(/packet) extension with the given elementName and namespace.
|
void |
setError(XMPPError error)
Deprecated.
Sets the error for this packet.
|
void |
setFrom(String from)
Deprecated.
Sets who the stanza(/packet) is being sent "from".
|
void |
setLanguage(String language)
Deprecated.
Sets the xml:lang of this Stanza.
|
void |
setPacketID(String packetID)
Deprecated.
use
setStanzaId(String) instead. |
void |
setStanzaId(String id)
Deprecated.
Sets the unique ID of the packet.
|
void |
setTo(String to)
Deprecated.
Sets who the stanza(/packet) is being sent "to".
|
String |
toString()
Deprecated.
|
static final String TEXT
static final String ITEM
String getStanzaId()
null.null if the id is not available.@Deprecated String getPacketID()
getStanzaId() instead.void setStanzaId(String id)
null as the packet's id value.id - the unique ID for the packet.@Deprecated void setPacketID(String packetID)
setStanzaId(String) instead.packetID - String getTo()
void setTo(String to)
to - who the stanza(/packet) is being sent to.String getFrom()
void setFrom(String from)
from - who the stanza(/packet) is being sent to.XMPPError getError()
void setError(XMPPError error)
error - the error to associate with this packet.String getLanguage()
void setLanguage(String language)
language - the xml:lang of this Stanza.List<ExtensionElement> getExtensions()
Set<ExtensionElement> getExtensions(String elementName, String namespace)
Changes to the returned set will update the stanza(/packet) extensions, if the returned set is not the empty set.
elementName - the element name, must not be null.namespace - the namespace of the element(s), must not be null.ExtensionElement getExtension(String namespace)
When possible, use getExtension(String,String) instead.
namespace - the namespace of the extension that is desired.<PE extends ExtensionElement> PE getExtension(String elementName, String namespace)
ProviderManager
class to handle custom parsing. In that case, the type of the Object
will be determined by the provider.elementName - the XML element name of the stanza(/packet) extension. (May be null)namespace - the XML element namespace of the stanza(/packet) extension.void addExtension(ExtensionElement extension)
extension - a stanza(/packet) extension.void addExtensions(Collection<ExtensionElement> extensions)
extensions - a collection of stanza(/packet) extensionsboolean hasExtension(String elementName, String namespace)
The argument elementName may be null.
elementName - namespace - boolean hasExtension(String namespace)
namespace - ExtensionElement removeExtension(String elementName, String namespace)
elementName - namespace - ExtensionElement removeExtension(ExtensionElement extension)
extension - the stanza(/packet) extension to remove.