Package com.day.cq.wcm.foundation
Class TextFormat
- java.lang.Object
-
- java.text.Format
-
- com.day.cq.wcm.foundation.TextFormat
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class TextFormat extends java.text.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
-
-
Constructor Summary
Constructors Constructor Description TextFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuffer
format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
Formats the object according to the standard modifiers, which are automatic line breaks and list formatting.java.lang.String
getTagBr()
java.lang.String
getTagOlClose()
java.lang.String
getTagOlItemClose()
java.lang.String
getTagOlItemOpen()
java.lang.String
getTagOlOpen()
java.lang.String
getTagUlClose()
java.lang.String
getTagUlItemClose()
java.lang.String
getTagUlItemOpen()
java.lang.String
getTagUlOpen()
boolean
isAutoBr()
boolean
isAutoList()
boolean
isEscapeXML()
java.lang.Object
parseObject(java.lang.String source, java.text.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(java.lang.String tagBr)
void
setTagOlClose(java.lang.String tagOlClose)
void
setTagOlItemClose(java.lang.String tagOlItemClose)
void
setTagOlItemOpen(java.lang.String tagOlItemOpen)
void
setTagOlOpen(java.lang.String tagOlOpen)
void
setTagUlClose(java.lang.String tagUlClose)
void
setTagUlItemClose(java.lang.String tagUlItemClose)
void
setTagUlItemOpen(java.lang.String tagUlItemOpen)
void
setTagUlOpen(java.lang.String tagUlOpen)
-
-
-
Method Detail
-
getTagBr
public java.lang.String getTagBr()
-
setTagBr
public void setTagBr(java.lang.String tagBr)
-
getTagOlOpen
public java.lang.String getTagOlOpen()
-
setTagOlOpen
public void setTagOlOpen(java.lang.String tagOlOpen)
-
getTagOlClose
public java.lang.String getTagOlClose()
-
setTagOlClose
public void setTagOlClose(java.lang.String tagOlClose)
-
getTagOlItemOpen
public java.lang.String getTagOlItemOpen()
-
setTagOlItemOpen
public void setTagOlItemOpen(java.lang.String tagOlItemOpen)
-
getTagOlItemClose
public java.lang.String getTagOlItemClose()
-
setTagOlItemClose
public void setTagOlItemClose(java.lang.String tagOlItemClose)
-
getTagUlOpen
public java.lang.String getTagUlOpen()
-
setTagUlOpen
public void setTagUlOpen(java.lang.String tagUlOpen)
-
getTagUlClose
public java.lang.String getTagUlClose()
-
setTagUlClose
public void setTagUlClose(java.lang.String tagUlClose)
-
getTagUlItemOpen
public java.lang.String getTagUlItemOpen()
-
setTagUlItemOpen
public void setTagUlItemOpen(java.lang.String tagUlItemOpen)
-
getTagUlItemClose
public java.lang.String getTagUlItemClose()
-
setTagUlItemClose
public void setTagUlItemClose(java.lang.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 java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition status)
TheTextFormat
class does not support parsing, so anUnsupportedOperationException
is thrown when trying to parse.- Specified by:
parseObject
in classjava.text.Format
- Parameters:
source
- The source string to parse. Ignored.status
- The position to define parsing. Ignored.- Throws:
java.lang.UnsupportedOperationException
- as it is not yet implemented.
-
format
public java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.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 classjava.text.Format
- 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
.
-
-