public abstract class OpenPgpContentElement extends Object implements ExtensionElement
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_JID |
static String |
ATTR_STAMP |
static String |
ELEM_PAYLOAD |
static String |
ELEM_TIME |
static String |
ELEM_TO |
Modifier | Constructor and Description |
---|---|
protected |
OpenPgpContentElement(Set<org.jxmpp.jid.Jid> to,
Date timestamp,
List<ExtensionElement> payload) |
Modifier and Type | Method and Description |
---|---|
protected void |
addCommonXml(XmlStringBuilder xml) |
protected void |
ensureTimestampStringSet() |
ExtensionElement |
getExtension(String namespace)
Returns the first extension of this stanza that has the given namespace.
|
<PE extends ExtensionElement> |
getExtension(String elementName,
String namespace)
Returns the first extension that matches the specified element name and
namespace, or null if it doesn't exist.
|
List<ExtensionElement> |
getExtensions()
Return the payload of the message.
|
List<ExtensionElement> |
getExtensions(String elementName,
String namespace)
Return a list of all extensions with the given element name and namespace.
|
String |
getNamespace()
Returns the root element XML namespace.
|
Date |
getTimestamp()
Return the timestamp on which the encrypted element has been created.
|
Set<org.jxmpp.jid.Jid> |
getTo()
Return the set of recipients.
|
InputStream |
toInputStream()
Return a
ByteArrayInputStream that reads the bytes of the XML representation of this element. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getElementName
public static final String ELEM_TO
public static final String ATTR_JID
public static final String ELEM_TIME
public static final String ATTR_STAMP
public static final String ELEM_PAYLOAD
protected OpenPgpContentElement(Set<org.jxmpp.jid.Jid> to, Date timestamp, List<ExtensionElement> payload)
public final Set<org.jxmpp.jid.Jid> getTo()
public final Date getTimestamp()
public final List<ExtensionElement> getExtensions()
public List<ExtensionElement> getExtensions(String elementName, String namespace)
Changes to the returned set will update the stanza extensions, if the returned set is not the empty set.
elementName
- the element name, must not be null.namespace
- the namespace of the element(s), must not be null.public ExtensionElement getExtension(String namespace)
When possible, use getExtension(String,String)
instead.
namespace
- the namespace of the extension that is desired.public <PE extends ExtensionElement> PE getExtension(String elementName, String namespace)
PE
- type of the ExtensionElement.elementName
- the XML element name of the extension. (May be null)namespace
- the XML element namespace of the extension.public String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement
protected void ensureTimestampStringSet()
protected void addCommonXml(XmlStringBuilder xml)
public InputStream toInputStream()
ByteArrayInputStream
that reads the bytes of the XML representation of this element.