public class ReferenceElement extends Object implements ExtensionElement
| Modifier and Type | Class and Description |
|---|---|
static class |
ReferenceElement.Type |
| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_ANCHOR |
static String |
ATTR_BEGIN |
static String |
ATTR_END |
static String |
ATTR_TYPE |
static String |
ATTR_URI |
static String |
ELEMENT |
| Constructor and Description |
|---|
ReferenceElement(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,
ExtensionElement child)
XEP-incompliant (v0.2) constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addMention(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(Stanza stanza)
Return true, if the stanza contains at least one reference extension.
|
String |
getAnchor() |
Integer |
getBegin() |
String |
getElementName()
Returns the root element name.
|
Integer |
getEnd() |
String |
getNamespace()
Returns the root element XML namespace.
|
static List<ReferenceElement> |
getReferencesFromStanza(Stanza stanza)
Return a list of all reference extensions contained in a stanza.
|
ReferenceElement.Type |
getType() |
URI |
getUri() |
XmlStringBuilder |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
public static final String ELEMENT
public static final String ATTR_BEGIN
public static final String ATTR_END
public static final String ATTR_TYPE
public static final String ATTR_ANCHOR
public static final String ATTR_URI
public ReferenceElement(Integer begin, Integer end, ReferenceElement.Type type, String anchor, URI uri, ExtensionElement child)
begin - end - type - anchor - uri - child - public ReferenceElement(Integer begin, Integer end, ReferenceElement.Type type, String anchor, URI uri)
begin - end - type - anchor - uri - public ReferenceElement.Type getType()
public static void addMention(Stanza stanza, int begin, int end, org.jxmpp.jid.BareJid jid)
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.public static List<ReferenceElement> getReferencesFromStanza(Stanza stanza)
stanza - stanzapublic static boolean containsReferences(Stanza stanza)
stanza - stanzapublic String getNamespace()
ExtensionElementgetNamespace in interface ExtensionElementpublic String getElementName()
NamedElementgetElementName in interface NamedElementpublic XmlStringBuilder toXML(String enclosingNamespace)
Element