Package org.jivesoftware.smackx.xhtmlim
Class XHTMLText
- java.lang.Object
-
- org.jivesoftware.smackx.xhtmlim.XHTMLText
-
public class XHTMLText extends java.lang.Object
An XHTMLText represents formatted text. This class also helps to build valid XHTML tags.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
A
static java.lang.String
BLOCKQUOTE
static java.lang.String
BR
static java.lang.String
CITE
static java.lang.String
CODE
static java.lang.String
EM
static java.lang.String
H
static java.lang.String
HREF
static java.lang.String
IMG
static java.lang.String
LI
static java.lang.String
NAMESPACE
static java.lang.String
OL
static java.lang.String
P
static java.lang.String
Q
static java.lang.String
SPAN
static java.lang.String
STRONG
static java.lang.String
STYLE
static java.lang.String
UL
-
Constructor Summary
Constructors Constructor Description XHTMLText(java.lang.String style, java.lang.String lang)
Creates a new XHTMLText with body tag params.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XHTMLText
append(java.lang.String textToAppend)
Appends a given text to the XHTMLText.XHTMLText
appendBrTag()
Appends a tag that inserts a single carriage return.XHTMLText
appendCloseAnchorTag()
Appends a tag that indicates that an anchor section ends.XHTMLText
appendCloseBlockQuoteTag()
Appends a tag that indicates that a blockquote section ends.XHTMLText
appendCloseBodyTag()
Appends a tag that indicates that the body section ends.XHTMLText
appendCloseCodeTag()
Appends a tag that indicates end of text that is the code for a program.XHTMLText
appendCloseEmTag()
Appends a tag that indicates end of emphasis.XHTMLText
appendCloseHeaderTag(int level)
Appends a tag that indicates that a header section ends.XHTMLText
appendCloseInlinedQuoteTag()
Appends a tag that indicates that an inlined quote section ends.XHTMLText
appendCloseLineItemTag()
Appends a tag that indicates that a line item section ends.XHTMLText
appendCloseOrderedListTag()
Appends a tag that indicates that an ordered list section ends.XHTMLText
appendCloseParagraphTag()
Appends a tag that indicates the end of a new paragraph.XHTMLText
appendCloseSpanTag()
Appends a tag that indicates that a span section ends.XHTMLText
appendCloseStrongTag()
Appends a tag that indicates that a strong section ends.XHTMLText
appendCloseUnorderedListTag()
Appends a tag that indicates that an unordered list section ends.XHTMLText
appendImageTag(java.lang.String align, java.lang.String alt, java.lang.String height, java.lang.String src, java.lang.String width)
Appends a tag that indicates an image.XHTMLText
appendLineItemTag(java.lang.String style)
Appends a tag that indicates the start of a new line item within a list.XHTMLText
appendOpenAnchorTag(java.lang.String href, java.lang.String style)
Appends a tag that indicates that an anchor section begins.XHTMLText
appendOpenBlockQuoteTag(java.lang.String style)
Appends a tag that indicates that a blockquote section begins.XHTMLText
appendOpenCiteTag()
Appends a tag that indicates a reference to work, such as a book, report or web site.XHTMLText
appendOpenCodeTag()
Appends a tag that indicates text that is the code for a program.XHTMLText
appendOpenEmTag()
Appends a tag that indicates emphasis.XHTMLText
appendOpenHeaderTag(int level, java.lang.String style)
Appends a tag that indicates a header, a title of a section of the message.XHTMLText
appendOpenInlinedQuoteTag(java.lang.String style)
Appends a tag that indicates that an inlined quote section begins.XHTMLText
appendOpenOrderedListTag(java.lang.String style)
Appends a tag that creates an ordered list.XHTMLText
appendOpenParagraphTag(java.lang.String style)
Appends a tag that indicates the start of a new paragraph.XHTMLText
appendOpenSpanTag(java.lang.String style)
Appends a tag that allows to set the fonts for a span of text.XHTMLText
appendOpenStrongTag()
Appends a tag that indicates text which should be more forceful than surrounding text.XHTMLText
appendOpenUnorderedListTag(java.lang.String style)
Appends a tag that creates an unordered list.java.lang.String
toString()
Returns the text of the XHTMLText.XmlStringBuilder
toXML()
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
A
public static final java.lang.String A
- See Also:
- Constant Field Values
-
HREF
public static final java.lang.String HREF
- See Also:
- Constant Field Values
-
STYLE
public static final java.lang.String STYLE
- See Also:
- Constant Field Values
-
BLOCKQUOTE
public static final java.lang.String BLOCKQUOTE
- See Also:
- Constant Field Values
-
BR
public static final java.lang.String BR
- See Also:
- Constant Field Values
-
CITE
public static final java.lang.String CITE
- See Also:
- Constant Field Values
-
CODE
public static final java.lang.String CODE
- See Also:
- Constant Field Values
-
EM
public static final java.lang.String EM
- See Also:
- Constant Field Values
-
H
public static final java.lang.String H
- See Also:
- Constant Field Values
-
IMG
public static final java.lang.String IMG
- See Also:
- Constant Field Values
-
LI
public static final java.lang.String LI
- See Also:
- Constant Field Values
-
OL
public static final java.lang.String OL
- See Also:
- Constant Field Values
-
UL
public static final java.lang.String UL
- See Also:
- Constant Field Values
-
P
public static final java.lang.String P
- See Also:
- Constant Field Values
-
Q
public static final java.lang.String Q
- See Also:
- Constant Field Values
-
SPAN
public static final java.lang.String SPAN
- See Also:
- Constant Field Values
-
STRONG
public static final java.lang.String STRONG
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
XHTMLText
public XHTMLText(java.lang.String style, java.lang.String lang)
Creates a new XHTMLText with body tag params.- Parameters:
style
- the XHTML style of the bodylang
- the language of the body
-
-
Method Detail
-
appendOpenAnchorTag
public XHTMLText appendOpenAnchorTag(java.lang.String href, java.lang.String style)
Appends a tag that indicates that an anchor section begins.- Parameters:
href
- indicates the URL being linked tostyle
- 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(java.lang.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, java.lang.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 3style
- 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(java.lang.String align, java.lang.String alt, java.lang.String height, java.lang.String src, java.lang.String width)
Appends a tag that indicates an image.- Parameters:
align
- how text should flow around the picturealt
- the text to show if you don't show the pictureheight
- how tall is the picturesrc
- where to get the picturewidth
- how wide is the picture- Returns:
- this.
-
appendLineItemTag
public XHTMLText appendLineItemTag(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String textToAppend)
Appends a given text to the XHTMLText.- Parameters:
textToAppend
- the text to append- Returns:
- this.
-
toString
public java.lang.String toString()
Returns the text of the XHTMLText.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the text of the XHTMLText
-
toXML
public XmlStringBuilder toXML()
-
-