Class XHTMLText


  • public class XHTMLText
    extends java.lang.Object
    An XHTMLText represents formatted text. This class also helps to build valid XHTML tags.
    • 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 body
        lang - 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 to
        style - the XHTML style of the anchor
        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.
      • 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.
      • 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 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​(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 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​(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.
      • 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.
      • 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.
      • 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.
      • 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.
      • appendOpenStrongTag

        public XHTMLText appendOpenStrongTag()
        Appends a tag that indicates text which should be more forceful than surrounding text.
        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 class java.lang.Object
        Returns:
        the text of the XHTMLText