public abstract class Stanza extends StreamPacket
Modifier and Type | Class and Description |
---|---|
static class |
Stanza.UnkownStanzaTypeException |
Modifier and Type | Method and Description |
---|---|
void |
addFlag(String flag) |
static boolean |
canBeConverted(Element element) |
static Stanza |
create(Element element)
Creates new stanza.
|
static IQ |
createIQ() |
static Message |
createMessage() |
static Presence |
createPresence() |
XMPPException.ErrorCondition |
getErrorCondition()
Returns XMPPException.ErrorCondition element.
|
String |
getErrorMessage() |
JID |
getFrom()
Returns 'from' attribute.
|
String |
getId()
Returns id of stanza.
|
JID |
getTo()
Returns 'to' attribute.
|
StanzaType |
getType()
Returns type of stanza.
|
StanzaType |
getType(StanzaType defaultValue)
Returns type of stanza.
|
boolean |
hasFlag(String flag) |
void |
removeFlag(String flag) |
void |
setFrom(JID jid)
Sets 'from' attribute.
|
void |
setId(String id)
Sets id of stanza
|
void |
setTo(JID jid)
Sets 'to' attribute.
|
void |
setType(StanzaType type)
Sets type of stanza.
|
getXmppStream, setXmppStream
addChild, equals, findChild, getAsString, getAttribute, getAttributes, getChildAfter, getChildElementValue, getChildElementValue, getChildren, getChildren, getChildrenNS, getChildrenNS, getFirstChild, getFirstChild, getName, getNextSibling, getParent, getValue, getWrappedElement, getXMLNS, hashCode, removeAttribute, removeChild, setAttribute, setAttributes, setChildElementValue, setChildElementValue, setParent, setValue, setXMLNS, toString
public static boolean canBeConverted(Element element) throws XMLException
XMLException
public static final Stanza create(Element element) throws JaxmppException
element
- element containing stanza.JaxmppException
public static final IQ createIQ() throws JaxmppException
JaxmppException
public static final Message createMessage() throws JaxmppException
JaxmppException
public static final Presence createPresence() throws JaxmppException
JaxmppException
public boolean hasFlag(String flag)
public void addFlag(String flag)
public void removeFlag(String flag)
public XMPPException.ErrorCondition getErrorCondition() throws XMLException
null
is element not present.XMLException
public String getErrorMessage() throws XMLException
XMLException
public JID getFrom() throws XMLException
XMLException
public void setFrom(JID jid) throws XMLException
jid
- JIDXMLException
public String getId() throws XMLException
XMLException
public void setId(String id) throws XMLException
id
- idXMLException
public JID getTo() throws XMLException
XMLException
public void setTo(JID jid) throws XMLException
jid
- JIDXMLException
public StanzaType getType() throws XMLException
null
if type not present.XMLException
public void setType(StanzaType type) throws XMLException
type
- StanzaTypeXMLException
public StanzaType getType(StanzaType defaultValue) throws XMLException
defaultValue
- default value. Will be returned if type of stanza id null
.defaultValue
if type not present.XMLException
Copyright © 2006–2022 Tigase. All rights reserved.