Class ReferenceElement
java.lang.Object
org.jivesoftware.smackx.reference.element.ReferenceElement
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlElement,org.jivesoftware.smack.packet.XmlLangElement
public class ReferenceElement
extends Object
implements org.jivesoftware.smack.packet.ExtensionElement
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReferenceElement(Integer begin, Integer end, ReferenceElement.Type type, String anchor, URI uri) XEP-Compliant constructor.ReferenceElement(Integer begin, Integer end, ReferenceElement.Type type, String anchor, URI uri, org.jivesoftware.smack.packet.XmlElement child) XEP-incompliant (v0.2) constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddMention(org.jivesoftware.smack.packet.Stanza stanza, int begin, int end, org.jxmpp.jid.BareJid jid) Add a reference to another users bare jid to a stanza.static booleancontainsReferences(org.jivesoftware.smack.packet.Stanza stanza) Return true, if the stanza contains at least one reference extension.getBegin()getEnd()static List<ReferenceElement>getReferencesFromStanza(org.jivesoftware.smack.packet.Stanza stanza) Return a list of all reference extensions contained in a stanza.getType()getUri()org.jivesoftware.smack.util.XmlStringBuildertoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.Element
toXML, toXMLMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
ATTR_BEGIN
- See Also:
-
ATTR_END
- See Also:
-
ATTR_TYPE
- See Also:
-
ATTR_ANCHOR
- See Also:
-
ATTR_URI
- See Also:
-
-
Constructor Details
-
ReferenceElement
public ReferenceElement(Integer begin, Integer end, ReferenceElement.Type type, String anchor, URI uri, org.jivesoftware.smack.packet.XmlElement child) XEP-incompliant (v0.2) constructor. This is needed for SIMS.- Parameters:
begin- TODO javadoc me pleaseend- TODO javadoc me pleasetype- TODO javadoc me pleaseanchor- TODO javadoc me pleaseuri- TODO javadoc me pleasechild- TODO javadoc me please
-
ReferenceElement
public ReferenceElement(Integer begin, Integer end, ReferenceElement.Type type, String anchor, URI uri) XEP-Compliant constructor.- Parameters:
begin- TODO javadoc me pleaseend- TODO javadoc me pleasetype- TODO javadoc me pleaseanchor- TODO javadoc me pleaseuri- TODO javadoc me please
-
-
Method Details
-
getBegin
-
getEnd
-
getType
-
getAnchor
-
getUri
-
addMention
public static void addMention(org.jivesoftware.smack.packet.Stanza stanza, int begin, int end, org.jxmpp.jid.BareJid jid) Add a reference to another users bare jid to a stanza.- Parameters:
stanza- stanza.begin- start index of the mention in the messages body.end- end index of the mention in the messages body.jid- referenced jid.
-
getReferencesFromStanza
public static List<ReferenceElement> getReferencesFromStanza(org.jivesoftware.smack.packet.Stanza stanza) Return a list of all reference extensions contained in a stanza. If there are no reference elements, return an empty list.- Parameters:
stanza- stanza- Returns:
- list of all references contained in the stanza
-
containsReferences
public static boolean containsReferences(org.jivesoftware.smack.packet.Stanza stanza) Return true, if the stanza contains at least one reference extension.- Parameters:
stanza- stanza- Returns:
- true if stanza contains references
-
getNamespace
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.XmlElement
-
getElementName
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
toXML
public org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) - Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-