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
  • Field Details

  • 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 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(Integer begin, Integer end, ReferenceElement.Type type, String anchor, 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 Details

    • getBegin

      public Integer getBegin()
    • getEnd

      public Integer getEnd()
    • getType

      public ReferenceElement.Type getType()
    • getAnchor

      public String getAnchor()
    • getUri

      public 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 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 String getNamespace()
      Specified by:
      getNamespace in interface org.jivesoftware.smack.packet.XmlElement
    • getElementName

      public 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