Class XHTMLExtension

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ELEMENT  
      static java.lang.String NAMESPACE  
      static javax.xml.namespace.QName QNAME  
    • Constructor Summary

      Constructors 
      Constructor Description
      XHTMLExtension()  
    • Method Detail

      • getElementName

        public java.lang.String getElementName()
        Returns the XML element name of the extension sub-packet root element. Always returns "html"
        Specified by:
        getElementName in interface NamedElement
        Returns:
        the XML element name of the stanza extension.
      • getNamespace

        public java.lang.String 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:
        getNamespace in interface FullyQualifiedElement
        Returns:
        the XML namespace of the stanza extension.
      • toXML

        public XmlStringBuilder toXML​(XmlEnvironment enclosingNamespace)
        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>
         
        Specified by:
        toXML in interface Element
      • getBodies

        public java.util.List<java.lang.CharSequence> getBodies()
        Returns a List of the bodies in the packet.
        Returns:
        a List of the bodies in the packet.
      • addBody

        public void addBody​(java.lang.CharSequence body)
        Adds a body to the packet.
        Parameters:
        body - the body to add.
      • getBodiesCount

        public int getBodiesCount()
        Returns a count of the bodies in the XHTML packet.
        Returns:
        the number of bodies in the XHTML packet.