Smack

org.jivesoftware.smackx
Class XHTMLText

java.lang.Object
  extended by org.jivesoftware.smackx.XHTMLText

public class XHTMLText
extends Object

An XHTMLText represents formatted text. This class also helps to build valid XHTML tags.

Author:
Gaston Dombiak

Constructor Summary
XHTMLText(String style, String lang)
          Creates a new XHTMLText with body tag params.
 
Method Summary
 void append(String textToAppend)
          Appends a given text to the XHTMLText.
 void appendBrTag()
          Appends a tag that inserts a single carriage return.
 void appendCloseAnchorTag()
          Appends a tag that indicates that an anchor section ends.
 void appendCloseBlockQuoteTag()
          Appends a tag that indicates that a blockquote section ends.
 void appendCloseCodeTag()
          Appends a tag that indicates end of text that is the code for a program.
 void appendCloseEmTag()
          Appends a tag that indicates end of emphasis.
 void appendCloseHeaderTag(int level)
          Appends a tag that indicates that a header section ends.
 void appendCloseInlinedQuoteTag()
          Appends a tag that indicates that an inlined quote section ends.
 void appendCloseOrderedListTag()
          Appends a tag that indicates that an ordered list section ends.
 void appendCloseParagraphTag()
          Appends a tag that indicates the end of a new paragraph.
 void appendCloseSpanTag()
          Appends a tag that indicates that a span section ends.
 void appendCloseStrongTag()
          Appends a tag that indicates that a strong section ends.
 void appendCloseUnorderedListTag()
          Appends a tag that indicates that an unordered list section ends.
 void appendImageTag(String align, String alt, String height, String src, String width)
          Appends a tag that indicates an image.
 void appendLineItemTag(String style)
          Appends a tag that indicates the start of a new line item within a list.
 void appendOpenAnchorTag(String href, String style)
          Appends a tag that indicates that an anchor section begins.
 void appendOpenBlockQuoteTag(String style)
          Appends a tag that indicates that a blockquote section begins.
 void appendOpenCiteTag()
          Appends a tag that indicates a reference to work, such as a book, report or web site.
 void appendOpenCodeTag()
          Appends a tag that indicates text that is the code for a program.
 void appendOpenEmTag()
          Appends a tag that indicates emphasis.
 void appendOpenHeaderTag(int level, String style)
          Appends a tag that indicates a header, a title of a section of the message.
 void appendOpenInlinedQuoteTag(String style)
          Appends a tag that indicates that an inlined quote section begins.
 void appendOpenOrderedListTag(String style)
          Appends a tag that creates an ordered list.
 void appendOpenParagraphTag(String style)
          Appends a tag that indicates the start of a new paragraph.
 void appendOpenSpanTag(String style)
          Appends a tag that allows to set the fonts for a span of text.
 void appendOpenStrongTag()
          Appends a tag that indicates text which should be more forceful than surrounding text.
 void appendOpenUnorderedListTag(String style)
          Appends a tag that creates an unordered list.
 String toString()
          Returns the text of the XHTMLText.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

appendOpenAnchorTag

public void 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

appendCloseAnchorTag

public void appendCloseAnchorTag()
Appends a tag that indicates that an anchor section ends.


appendOpenBlockQuoteTag

public void appendOpenBlockQuoteTag(String style)
Appends a tag that indicates that a blockquote section begins.

Parameters:
style - the XHTML style of the blockquote

appendCloseBlockQuoteTag

public void appendCloseBlockQuoteTag()
Appends a tag that indicates that a blockquote section ends.


appendBrTag

public void appendBrTag()
Appends a tag that inserts a single carriage return.


appendOpenCiteTag

public void appendOpenCiteTag()
Appends a tag that indicates a reference to work, such as a book, report or web site.


appendOpenCodeTag

public void appendOpenCodeTag()
Appends a tag that indicates text that is the code for a program.


appendCloseCodeTag

public void appendCloseCodeTag()
Appends a tag that indicates end of text that is the code for a program.


appendOpenEmTag

public void appendOpenEmTag()
Appends a tag that indicates emphasis.


appendCloseEmTag

public void appendCloseEmTag()
Appends a tag that indicates end of emphasis.


appendOpenHeaderTag

public void 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 should be a value between 1 and 3
style - the XHTML style of the blockquote

appendCloseHeaderTag

public void appendCloseHeaderTag(int level)
Appends a tag that indicates that a header section ends.

Parameters:
level - the level of the Header. It should be a value between 1 and 3

appendImageTag

public void 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

appendLineItemTag

public void 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

appendOpenOrderedListTag

public void 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

appendCloseOrderedListTag

public void appendCloseOrderedListTag()
Appends a tag that indicates that an ordered list section ends.


appendOpenUnorderedListTag

public void 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

appendCloseUnorderedListTag

public void appendCloseUnorderedListTag()
Appends a tag that indicates that an unordered list section ends.


appendOpenParagraphTag

public void 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

appendCloseParagraphTag

public void 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.


appendOpenInlinedQuoteTag

public void appendOpenInlinedQuoteTag(String style)
Appends a tag that indicates that an inlined quote section begins.

Parameters:
style - the style of the inlined quote

appendCloseInlinedQuoteTag

public void appendCloseInlinedQuoteTag()
Appends a tag that indicates that an inlined quote section ends.


appendOpenSpanTag

public void 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

appendCloseSpanTag

public void appendCloseSpanTag()
Appends a tag that indicates that a span section ends.


appendOpenStrongTag

public void appendOpenStrongTag()
Appends a tag that indicates text which should be more forceful than surrounding text.


appendCloseStrongTag

public void appendCloseStrongTag()
Appends a tag that indicates that a strong section ends.


append

public void append(String textToAppend)
Appends a given text to the XHTMLText.

Parameters:
textToAppend - the text to append

toString

public String toString()
Returns the text of the XHTMLText. Note: Automatically adds the closing body tag.

Overrides:
toString in class Object
Returns:
the text of the XHTMLText

Smack

Copyright © 2003 Jive Software.