Class XHTMLExtension
java.lang.Object
org.jivesoftware.smackx.xhtmlim.packet.XHTMLExtension
- All Implemented Interfaces:
Element,ExtensionElement,NamedElement,XmlElement,XmlLangElement
An XHTML sub-packet, which is used by XMPP clients to exchange formatted text. The XHTML
extension is only a subset of XHTML 1.0.
The following link summarizes the requirements of XHTML IM: XEP-0071: XHTML-IM.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBody(CharSequence body) Adds a body to the packet.static XHTMLExtensionfrom(MessageView message) Returns a List of the bodies in the packet.intReturns a count of the bodies in the XHTML packet.Returns the XML element name of the extension sub-packet root element.Returns the XML namespace of the extension sub-packet root element.toXML(XmlEnvironment enclosingNamespace) Returns the XML representation of a XHTML extension according the specification.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
-
Constructor Details
-
XHTMLExtension
public XHTMLExtension()
-
-
Method Details
-
getElementName
Returns the XML element name of the extension sub-packet root element. Always returns "html"- Specified by:
getElementNamein interfaceNamedElement- Returns:
- the XML element name of the stanza extension.
-
getNamespace
Returns the XML namespace of the extension sub-packet root element. According the specification the namespace is always "http://jabber.org/protocol/xhtml-im"- Specified by:
getNamespacein interfaceXmlElement- Returns:
- the XML namespace of the stanza extension.
-
toXML
Returns the XML representation of a XHTML extension according the specification. Usually the XML representation will be inside of a Message XML representation like in the following example:<message id="MlIpV-4" to="gato1@gato.home" from="gato3@gato.home/Smack"> <subject>Any subject you want</subject> <body>This message contains something interesting.</body> <html xmlns="http://jabber.org/protocol/xhtml-im"> <body><p style='font-size:large'>This message contains something <em>interesting</em>.</p></body> </html> </message> -
getBodies
Returns a List of the bodies in the packet.- Returns:
- a List of the bodies in the packet.
-
addBody
Adds a body to the packet.- Parameters:
body- the body to add.
-
getBodiesCount
Returns a count of the bodies in the XHTML packet.- Returns:
- the number of bodies in the XHTML packet.
-
from
-