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.util.Locale locale)
Deprecated.
since 2.1
|
StringFormatter(java.lang.String format)
constructor with a format string argument
|
StringFormatter(java.lang.String format,
java.util.Locale locale)
Deprecated.
since 2.1
|
StringFormatter(java.lang.String format,
com.ibm.icu.util.ULocale locale)
Constructor with the format string and locale
|
StringFormatter(com.ibm.icu.util.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.
|
com.ibm.icu.util.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(java.util.Locale theLocale)
Deprecated.
since 2.1
|
void |
setLocale(com.ibm.icu.util.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(com.ibm.icu.util.ULocale locale)
public StringFormatter(java.util.Locale locale)
public StringFormatter(java.lang.String format)
format
- the format stringpublic StringFormatter(java.lang.String format, com.ibm.icu.util.ULocale locale)
format
- the format stringlocale
- the localepublic StringFormatter(java.lang.String format, java.util.Locale locale)
public void applyPattern(java.lang.String format)
format
- the format patternpublic java.lang.String getPattern()
public com.ibm.icu.util.ULocale getULocale()
public java.util.Locale getLocale()
public void setLocale(com.ibm.icu.util.ULocale theLocale)
public void setLocale(java.util.Locale 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 © 2008 Actuate Corp. All rights reserved.