public class ReferenceElement extends java.lang.Object implements ExtensionElement
Modifier and Type | Class and Description |
---|---|
static class |
ReferenceElement.Type |
Modifier and Type | Field and 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 and 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,
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.
|
java.lang.String |
getAnchor() |
java.lang.Integer |
getBegin() |
java.lang.String |
getElementName()
Returns the root element name.
|
java.lang.Integer |
getEnd() |
java.lang.String |
getNamespace()
Returns the root element XML namespace.
|
static java.util.List<ReferenceElement> |
getReferencesFromStanza(Stanza stanza)
Return a list of all reference extensions contained in a stanza.
|
ReferenceElement.Type |
getType() |
java.net.URI |
getUri() |
XmlStringBuilder |
toXML()
Returns the XML representation of this Element.
|
public static final java.lang.String ELEMENT
public static final java.lang.String ATTR_BEGIN
public static final java.lang.String ATTR_END
public static final java.lang.String ATTR_TYPE
public static final java.lang.String ATTR_ANCHOR
public static final java.lang.String ATTR_URI
public ReferenceElement(java.lang.Integer begin, java.lang.Integer end, ReferenceElement.Type type, java.lang.String anchor, java.net.URI uri, ExtensionElement child)
begin
- end
- type
- anchor
- uri
- child
- public ReferenceElement(java.lang.Integer begin, java.lang.Integer end, ReferenceElement.Type type, java.lang.String anchor, java.net.URI uri)
begin
- end
- type
- anchor
- uri
- public java.lang.Integer getBegin()
public java.lang.Integer getEnd()
public ReferenceElement.Type getType()
public java.lang.String getAnchor()
public java.net.URI getUri()
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 java.util.List<ReferenceElement> getReferencesFromStanza(Stanza stanza)
stanza
- stanzapublic static boolean containsReferences(Stanza stanza)
stanza
- stanzapublic java.lang.String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement
public java.lang.String getElementName()
NamedElement
getElementName
in interface NamedElement
public XmlStringBuilder toXML()
Element