Class TextFormat

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class TextFormat
    extends Format
    The AutoFormatter class implements the automatic conversion of line endings to <br> HTML lists. This implementation only supports automatically converting bullet and numbered lists as well as line breaking.
    See Also:
    Serialized Form
    • Constructor Detail

      • TextFormat

        public TextFormat()
    • Method Detail

      • getTagBr

        public String getTagBr()
      • setTagBr

        public void setTagBr​(String tagBr)
      • getTagOlOpen

        public String getTagOlOpen()
      • setTagOlOpen

        public void setTagOlOpen​(String tagOlOpen)
      • getTagOlClose

        public String getTagOlClose()
      • setTagOlClose

        public void setTagOlClose​(String tagOlClose)
      • getTagOlItemOpen

        public String getTagOlItemOpen()
      • setTagOlItemOpen

        public void setTagOlItemOpen​(String tagOlItemOpen)
      • getTagOlItemClose

        public String getTagOlItemClose()
      • setTagOlItemClose

        public void setTagOlItemClose​(String tagOlItemClose)
      • getTagUlOpen

        public String getTagUlOpen()
      • setTagUlOpen

        public void setTagUlOpen​(String tagUlOpen)
      • getTagUlClose

        public String getTagUlClose()
      • setTagUlClose

        public void setTagUlClose​(String tagUlClose)
      • getTagUlItemOpen

        public String getTagUlItemOpen()
      • setTagUlItemOpen

        public void setTagUlItemOpen​(String tagUlItemOpen)
      • getTagUlItemClose

        public String getTagUlItemClose()
      • setTagUlItemClose

        public void setTagUlItemClose​(String tagUlItemClose)
      • isAutoBr

        public boolean isAutoBr()
      • setAutoBr

        public void setAutoBr​(boolean autoBr)
      • isAutoList

        public boolean isAutoList()
      • setAutoList

        public void setAutoList​(boolean autoList)
      • isEscapeXML

        public boolean isEscapeXML()
      • setEscapeXML

        public void setEscapeXML​(boolean escapeXML)
      • parseObject

        public Object parseObject​(String source,
                                  ParsePosition status)
        The TextFormat class does not support parsing, so an UnsupportedOperationException is thrown when trying to parse.
        Specified by:
        parseObject in class Format
        Parameters:
        source - The source string to parse. Ignored.
        status - The position to define parsing. Ignored.
        Throws:
        UnsupportedOperationException - as it is not yet implemented.
      • format

        public StringBuffer format​(Object obj,
                                   StringBuffer toAppendTo,
                                   FieldPosition pos)
        Formats the object according to the standard modifiers, which are automatic line breaks and list formatting. This implementation only supports strings and completely ignores the pos parameter.
        Specified by:
        format in class Format
        Parameters:
        obj - The object to format, which must be a String or a ClassCastException will be thrown.
        toAppendTo - Where to append the formatted data. If null, a new string buffer is allocated.
        pos - Formatting position information. Not used.
        Returns:
        a StringBuffer containing the formatted string. This is either the same as toAppendTo or a newly allocated StringBuffer if the parameter is null.