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.StringAstatic java.lang.StringBLOCKQUOTEstatic java.lang.StringBRstatic java.lang.StringCITEstatic java.lang.StringCODEstatic java.lang.StringEMstatic java.lang.StringHstatic java.lang.StringHREFstatic java.lang.StringIMGstatic java.lang.StringLIstatic java.lang.StringNAMESPACEstatic java.lang.StringOLstatic java.lang.StringPstatic java.lang.StringQstatic java.lang.StringSPANstatic java.lang.StringSTRONGstatic java.lang.StringSTYLEstatic java.lang.StringUL
-
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 XHTMLTextappend(java.lang.String textToAppend)Appends a given text to the XHTMLText.XHTMLTextappendBrTag()Appends a tag that inserts a single carriage return.XHTMLTextappendCloseAnchorTag()Appends a tag that indicates that an anchor section ends.XHTMLTextappendCloseBlockQuoteTag()Appends a tag that indicates that a blockquote section ends.XHTMLTextappendCloseBodyTag()Appends a tag that indicates that the body section ends.XHTMLTextappendCloseCodeTag()Appends a tag that indicates end of text that is the code for a program.XHTMLTextappendCloseEmTag()Appends a tag that indicates end of emphasis.XHTMLTextappendCloseHeaderTag(int level)Appends a tag that indicates that a header section ends.XHTMLTextappendCloseInlinedQuoteTag()Appends a tag that indicates that an inlined quote section ends.XHTMLTextappendCloseLineItemTag()Appends a tag that indicates that a line item section ends.XHTMLTextappendCloseOrderedListTag()Appends a tag that indicates that an ordered list section ends.XHTMLTextappendCloseParagraphTag()Appends a tag that indicates the end of a new paragraph.XHTMLTextappendCloseSpanTag()Appends a tag that indicates that a span section ends.XHTMLTextappendCloseStrongTag()Appends a tag that indicates that a strong section ends.XHTMLTextappendCloseUnorderedListTag()Appends a tag that indicates that an unordered list section ends.XHTMLTextappendImageTag(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.XHTMLTextappendLineItemTag(java.lang.String style)Appends a tag that indicates the start of a new line item within a list.XHTMLTextappendOpenAnchorTag(java.lang.String href, java.lang.String style)Appends a tag that indicates that an anchor section begins.XHTMLTextappendOpenBlockQuoteTag(java.lang.String style)Appends a tag that indicates that a blockquote section begins.XHTMLTextappendOpenCiteTag()Appends a tag that indicates a reference to work, such as a book, report or web site.XHTMLTextappendOpenCodeTag()Appends a tag that indicates text that is the code for a program.XHTMLTextappendOpenEmTag()Appends a tag that indicates emphasis.XHTMLTextappendOpenHeaderTag(int level, java.lang.String style)Appends a tag that indicates a header, a title of a section of the message.XHTMLTextappendOpenInlinedQuoteTag(java.lang.String style)Appends a tag that indicates that an inlined quote section begins.XHTMLTextappendOpenOrderedListTag(java.lang.String style)Appends a tag that creates an ordered list.XHTMLTextappendOpenParagraphTag(java.lang.String style)Appends a tag that indicates the start of a new paragraph.XHTMLTextappendOpenSpanTag(java.lang.String style)Appends a tag that allows to set the fonts for a span of text.XHTMLTextappendOpenStrongTag()Appends a tag that indicates text which should be more forceful than surrounding text.XHTMLTextappendOpenUnorderedListTag(java.lang.String style)Appends a tag that creates an unordered list.java.lang.StringtoString()Returns the text of the XHTMLText.XmlStringBuildertoXML()
-
-
-
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:
toStringin classjava.lang.Object- Returns:
- the text of the XHTMLText
-
toXML
public XmlStringBuilder toXML()
-
-