Class ReferenceElement

    • Constructor Detail

      • ReferenceElement

        public ReferenceElement​(java.lang.Integer begin,
                                java.lang.Integer end,
                                ReferenceElement.Type type,
                                java.lang.String anchor,
                                java.net.URI uri,
                                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​(Stanza stanza,
                                      int begin,
                                      int end,
                                      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<ReferenceElementgetReferencesFromStanza​(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​(Stanza stanza)
        Return true, if the stanza contains at least one reference extension.
        Parameters:
        stanza - stanza
        Returns:
        true if stanza contains references