public class StringFormatter extends java.lang.Object implements IFormatter
IFormatter.DefaultFormatter
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
formatPattern |
protected static java.util.logging.Logger |
logger
logger used to log syntax errors.
|
Constructor and Description |
---|
StringFormatter()
constructor with no argument
|
StringFormatter(java.lang.String format,
ULocale locale)
Constructor with the format string and locale
|
StringFormatter(ULocale locale)
constructor with no formatting string
|
Modifier and Type | Method and Description |
---|---|
void |
applyPattern(java.lang.String format) |
java.lang.String |
format(java.lang.String str)
returns the formated string for the string parameter.
|
java.lang.String |
formatValue(java.lang.Object value)
format the value object into a string.
|
java.util.Locale |
getLocale()
Deprecated.
since 2.1
|
java.lang.String |
getPattern()
returns the original format string.
|
ULocale |
getULocale()
getLoacle() method, return the locale value.
|
java.lang.String |
parser(java.lang.String str)
Parses the input string into a unformatted string type.
|
void |
setLocale(ULocale theLocale)
setLoacle() method, set the locale value.
|
void |
setTrim(boolean trim) |
protected static java.util.logging.Logger logger
protected java.lang.String formatPattern
public StringFormatter()
public StringFormatter(ULocale locale)
public StringFormatter(java.lang.String format, ULocale locale)
format
- the format stringlocale
- the localepublic void applyPattern(java.lang.String format)
format
- the format patternpublic java.lang.String getPattern()
public ULocale getULocale()
public java.util.Locale getLocale()
public void setLocale(ULocale theLocale)
public java.lang.String format(java.lang.String str)
str
- format stringpublic java.lang.String parser(java.lang.String str) throws java.text.ParseException
str
- the input string to parsejava.text.ParseException
- if the specified string cannot be parsed according to specified pattern.public void setTrim(boolean trim)
trim
- the trim to setpublic java.lang.String formatValue(java.lang.Object value)
IFormatter
formatValue
in interface IFormatter
Copyright © 2014 OpenText Corp. All rights reserved.