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
public class TextFormat extends Format
TheAutoFormatter
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.text.Format
Format.Field
-
-
Constructor Summary
Constructors Constructor Description TextFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringBuffer
format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
Formats the object according to the standard modifiers, which are automatic line breaks and list formatting.String
getTagBr()
String
getTagOlClose()
String
getTagOlItemClose()
String
getTagOlItemOpen()
String
getTagOlOpen()
String
getTagUlClose()
String
getTagUlItemClose()
String
getTagUlItemOpen()
String
getTagUlOpen()
boolean
isAutoBr()
boolean
isAutoList()
boolean
isEscapeXML()
Object
parseObject(String source, ParsePosition status)
TheTextFormat
class does not support parsing, so anUnsupportedOperationException
is thrown when trying to parse.void
setAutoBr(boolean autoBr)
void
setAutoList(boolean autoList)
void
setEscapeXML(boolean escapeXML)
void
setTagBr(String tagBr)
void
setTagOlClose(String tagOlClose)
void
setTagOlItemClose(String tagOlItemClose)
void
setTagOlItemOpen(String tagOlItemOpen)
void
setTagOlOpen(String tagOlOpen)
void
setTagUlClose(String tagUlClose)
void
setTagUlItemClose(String tagUlItemClose)
void
setTagUlItemOpen(String tagUlItemOpen)
void
setTagUlOpen(String tagUlOpen)
-
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
-
-
-
-
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)
TheTextFormat
class does not support parsing, so anUnsupportedOperationException
is thrown when trying to parse.- Specified by:
parseObject
in 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
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 classFormat
- Parameters:
obj
- The object to format, which must be a String or aClassCastException
will be thrown.toAppendTo
- Where to append the formatted data. Ifnull
, a new string buffer is allocated.pos
- Formatting position information. Not used.- Returns:
- a
StringBuffer
containing the formatted string. This is either the same astoAppendTo
or a newly allocatedStringBuffer
if the parameter isnull
.
-
-