Class XHTMLText

java.lang.Object
org.jivesoftware.smackx.xhtmlim.XHTMLText

public class XHTMLText extends Object
An XHTMLText represents formatted text. This class also helps to build valid XHTML tags.
  • Field Details

  • Constructor Details

    • XHTMLText

      public XHTMLText(String style, String lang)
      Creates a new XHTMLText with body tag params.
      Parameters:
      style - the XHTML style of the body
      lang - the language of the body
  • Method Details

    • appendOpenAnchorTag

      public XHTMLText appendOpenAnchorTag(String href, String style)
      Appends a tag that indicates that an anchor section begins.
      Parameters:
      href - indicates the URL being linked to
      style - the XHTML style of the anchor
      Returns:
      this.
    • appendCloseAnchorTag

      public XHTMLText appendCloseAnchorTag()
      Appends a tag that indicates that an anchor section ends.
      Returns:
      this.
    • appendOpenBlockQuoteTag

      public XHTMLText appendOpenBlockQuoteTag(String style)
      Appends a tag that indicates that a blockquote section begins.
      Parameters:
      style - the XHTML style of the blockquote
      Returns:
      this.
    • appendCloseBlockQuoteTag

      public XHTMLText appendCloseBlockQuoteTag()
      Appends a tag that indicates that a blockquote section ends.
      Returns:
      this.
    • appendCloseBodyTag

      public XHTMLText appendCloseBodyTag()
      Appends a tag that indicates that the body section ends.
      Returns:
      this.
    • appendBrTag

      public XHTMLText appendBrTag()
      Appends a tag that inserts a single carriage return.
      Returns:
      this.
    • appendOpenCiteTag

      public XHTMLText appendOpenCiteTag()
      Appends a tag that indicates a reference to work, such as a book, report or web site.
      Returns:
      this.
    • appendOpenCodeTag

      public XHTMLText appendOpenCodeTag()
      Appends a tag that indicates text that is the code for a program.
      Returns:
      this.
    • appendCloseCodeTag

      public XHTMLText appendCloseCodeTag()
      Appends a tag that indicates end of text that is the code for a program.
      Returns:
      this.
    • appendOpenEmTag

      public XHTMLText appendOpenEmTag()
      Appends a tag that indicates emphasis.
      Returns:
      this.
    • appendCloseEmTag

      public XHTMLText appendCloseEmTag()
      Appends a tag that indicates end of emphasis.
      Returns:
      this.
    • appendOpenHeaderTag

      public XHTMLText appendOpenHeaderTag(int level, String style)
      Appends a tag that indicates a header, a title of a section of the message.
      Parameters:
      level - the level of the Header. It must be a value between 1 and 3
      style - the XHTML style of the blockquote
      Returns:
      this.
    • appendCloseHeaderTag

      public XHTMLText appendCloseHeaderTag(int level)
      Appends a tag that indicates that a header section ends.
      Parameters:
      level - the level of the Header. It must be a value between 1 and 3
      Returns:
      this.
    • appendImageTag

      public XHTMLText appendImageTag(String align, String alt, String height, String src, String width)
      Appends a tag that indicates an image.
      Parameters:
      align - how text should flow around the picture
      alt - the text to show if you don't show the picture
      height - how tall is the picture
      src - where to get the picture
      width - how wide is the picture
      Returns:
      this.
    • appendLineItemTag

      public XHTMLText appendLineItemTag(String style)
      Appends a tag that indicates the start of a new line item within a list.
      Parameters:
      style - the style of the line item
      Returns:
      this.
    • appendCloseLineItemTag

      public XHTMLText appendCloseLineItemTag()
      Appends a tag that indicates that a line item section ends.
      Returns:
      this.
    • appendOpenOrderedListTag

      public XHTMLText appendOpenOrderedListTag(String style)
      Appends a tag that creates an ordered list. "Ordered" means that the order of the items in the list is important. To show this, browsers automatically number the list.
      Parameters:
      style - the style of the ordered list
      Returns:
      this.
    • appendCloseOrderedListTag

      public XHTMLText appendCloseOrderedListTag()
      Appends a tag that indicates that an ordered list section ends.
      Returns:
      this.
    • appendOpenUnorderedListTag

      public XHTMLText appendOpenUnorderedListTag(String style)
      Appends a tag that creates an unordered list. The unordered part means that the items in the list are not in any particular order.
      Parameters:
      style - the style of the unordered list
      Returns:
      this.
    • appendCloseUnorderedListTag

      public XHTMLText appendCloseUnorderedListTag()
      Appends a tag that indicates that an unordered list section ends.
      Returns:
      this.
    • appendOpenParagraphTag

      public XHTMLText appendOpenParagraphTag(String style)
      Appends a tag that indicates the start of a new paragraph. This is usually rendered with two carriage returns, producing a single blank line in between the two paragraphs.
      Parameters:
      style - the style of the paragraph
      Returns:
      this.
    • appendCloseParagraphTag

      public XHTMLText appendCloseParagraphTag()
      Appends a tag that indicates the end of a new paragraph. This is usually rendered with two carriage returns, producing a single blank line in between the two paragraphs.
      Returns:
      this.
    • appendOpenInlinedQuoteTag

      public XHTMLText appendOpenInlinedQuoteTag(String style)
      Appends a tag that indicates that an inlined quote section begins.
      Parameters:
      style - the style of the inlined quote
      Returns:
      this.
    • appendCloseInlinedQuoteTag

      public XHTMLText appendCloseInlinedQuoteTag()
      Appends a tag that indicates that an inlined quote section ends.
      Returns:
      this.
    • appendOpenSpanTag

      public XHTMLText appendOpenSpanTag(String style)
      Appends a tag that allows to set the fonts for a span of text.
      Parameters:
      style - the style for a span of text
      Returns:
      this.
    • appendCloseSpanTag

      public XHTMLText appendCloseSpanTag()
      Appends a tag that indicates that a span section ends.
      Returns:
      this.
    • appendOpenStrongTag

      public XHTMLText appendOpenStrongTag()
      Appends a tag that indicates text which should be more forceful than surrounding text.
      Returns:
      this.
    • appendCloseStrongTag

      public XHTMLText appendCloseStrongTag()
      Appends a tag that indicates that a strong section ends.
      Returns:
      this.
    • append

      public XHTMLText append(String textToAppend)
      Appends a given text to the XHTMLText.
      Parameters:
      textToAppend - the text to append
      Returns:
      this.
    • toString

      public String toString()
      Returns the text of the XHTMLText.
      Overrides:
      toString in class Object
      Returns:
      the text of the XHTMLText
    • toXML

      public org.jivesoftware.smack.util.XmlStringBuilder toXML()