Class ReferenceElement

  • All Implemented Interfaces:
    org.jivesoftware.smack.packet.Element, org.jivesoftware.smack.packet.ExtensionElement, org.jivesoftware.smack.packet.FullyQualifiedElement, org.jivesoftware.smack.packet.NamedElement, org.jivesoftware.smack.packet.XmlLangElement

    public class ReferenceElement
    extends java.lang.Object
    implements org.jivesoftware.smack.packet.ExtensionElement
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ReferenceElement.Type  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATTR_ANCHOR  
      static java.lang.String ATTR_BEGIN  
      static java.lang.String ATTR_END  
      static java.lang.String ATTR_TYPE  
      static java.lang.String ATTR_URI  
      static java.lang.String ELEMENT  
    • Constructor Summary

      Constructors 
      Constructor Description
      ReferenceElement​(java.lang.Integer begin, java.lang.Integer end, ReferenceElement.Type type, java.lang.String anchor, java.net.URI uri)
      XEP-Compliant constructor.
      ReferenceElement​(java.lang.Integer begin, java.lang.Integer end, ReferenceElement.Type type, java.lang.String anchor, java.net.URI uri, org.jivesoftware.smack.packet.ExtensionElement child)
      XEP-incompliant (v0.2) constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      static boolean containsReferences​(org.jivesoftware.smack.packet.Stanza stanza)
      Return true, if the stanza contains at least one reference extension.
      java.lang.String getAnchor()  
      java.lang.Integer getBegin()  
      java.lang.String getElementName()  
      java.lang.Integer getEnd()  
      java.lang.String getNamespace()  
      static java.util.List<ReferenceElement> getReferencesFromStanza​(org.jivesoftware.smack.packet.Stanza stanza)
      Return a list of all reference extensions contained in a stanza.
      ReferenceElement.Type getType()  
      java.net.URI getUri()  
      org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.jivesoftware.smack.packet.Element

        toXML, toXML
      • Methods inherited from interface org.jivesoftware.smack.packet.FullyQualifiedElement

        getLanguage, getQName
    • Constructor Detail

      • ReferenceElement

        public ReferenceElement​(java.lang.Integer begin,
                                java.lang.Integer end,
                                ReferenceElement.Type type,
                                java.lang.String anchor,
                                java.net.URI uri,
                                org.jivesoftware.smack.packet.ExtensionElement child)
        XEP-incompliant (v0.2) constructor. This is needed for SIMS.
        Parameters:
        begin - TODO javadoc me please
        end - TODO javadoc me please
        type - TODO javadoc me please
        anchor - TODO javadoc me please
        uri - TODO javadoc me please
        child - TODO javadoc me please
      • ReferenceElement

        public ReferenceElement​(java.lang.Integer begin,
                                java.lang.Integer end,
                                ReferenceElement.Type type,
                                java.lang.String anchor,
                                java.net.URI uri)
        XEP-Compliant constructor.
        Parameters:
        begin - TODO javadoc me please
        end - TODO javadoc me please
        type - TODO javadoc me please
        anchor - TODO javadoc me please
        uri - TODO javadoc me please
    • Method Detail

      • getBegin

        public java.lang.Integer getBegin()
      • getEnd

        public java.lang.Integer getEnd()
      • getAnchor

        public java.lang.String getAnchor()
      • getUri

        public java.net.URI 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 java.util.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

        public java.lang.String getNamespace()
        Specified by:
        getNamespace in interface org.jivesoftware.smack.packet.FullyQualifiedElement
      • getElementName

        public java.lang.String getElementName()
        Specified by:
        getElementName in interface org.jivesoftware.smack.packet.NamedElement
      • toXML

        public org.jivesoftware.smack.util.XmlStringBuilder toXML​(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
        Specified by:
        toXML in interface org.jivesoftware.smack.packet.Element