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