Package com.day.cq.wcm.foundation
Class TextFormat
java.lang.Object
java.text.Format
com.day.cq.wcm.foundation.TextFormat
- All Implemented Interfaces:
Serializable,Cloneable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.Format
Format.Field -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat(Object obj, StringBuffer toAppendTo, FieldPosition pos) Formats the object according to the standard modifiers, which are automatic line breaks and list formatting.getTagBr()booleanisAutoBr()booleanbooleanparseObject(String source, ParsePosition status) TheTextFormatclass does not support parsing, so anUnsupportedOperationExceptionis thrown when trying to parse.voidsetAutoBr(boolean autoBr) voidsetAutoList(boolean autoList) voidsetEscapeXML(boolean escapeXML) voidvoidsetTagOlClose(String tagOlClose) voidsetTagOlItemClose(String tagOlItemClose) voidsetTagOlItemOpen(String tagOlItemOpen) voidsetTagOlOpen(String tagOlOpen) voidsetTagUlClose(String tagUlClose) voidsetTagUlItemClose(String tagUlItemClose) voidsetTagUlItemOpen(String tagUlItemOpen) voidsetTagUlOpen(String tagUlOpen) Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
-
Constructor Details
-
TextFormat
public TextFormat()
-
-
Method Details
-
getTagBr
-
setTagBr
-
getTagOlOpen
-
setTagOlOpen
-
getTagOlClose
-
setTagOlClose
-
getTagOlItemOpen
-
setTagOlItemOpen
-
getTagOlItemClose
-
setTagOlItemClose
-
getTagUlOpen
-
setTagUlOpen
-
getTagUlClose
-
setTagUlClose
-
getTagUlItemOpen
-
setTagUlItemOpen
-
getTagUlItemClose
-
setTagUlItemClose
-
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
TheTextFormatclass does not support parsing, so anUnsupportedOperationExceptionis thrown when trying to parse.- Specified by:
parseObjectin classFormat- Parameters:
source- The source string to parse. Ignored.status- The position to define parsing. Ignored.- Throws:
UnsupportedOperationException- as it is not yet implemented.
-
format
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:
formatin classFormat- Parameters:
obj- The object to format, which must be a String or aClassCastExceptionwill be thrown.toAppendTo- Where to append the formatted data. Ifnull, a new string buffer is allocated.pos- Formatting position information. Not used.- Returns:
- a
StringBuffercontaining the formatted string. This is either the same astoAppendToor a newly allocatedStringBufferif the parameter isnull.
-