|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.lessy.util.format.FormatUtil
public class FormatUtil
Helper class around custom formatting of a value. Basic formatters for float, currency and date are pre-registered. Custom formatters can be registered as additionally or the default formatters can be overwritten.
| Field Summary | |
|---|---|
static String |
CURRENCY
Constant for the currency-formatter |
static String |
DATE
Constant for the date-formatter |
static String |
FLOAT
Constant for the float-formatter |
static String |
TIME
Constant for the time-formatter |
| Constructor Summary | |
|---|---|
FormatUtil()
|
|
| Method Summary | |
|---|---|
static void |
addFormatter(String pName,
FormatIF pFormatter)
Registers a new formatter. |
static String |
format(Object pValue,
String pFormat,
Object pDefault,
Locale pLocale,
Properties pProps)
Wrapper method for formatting a value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FLOAT
public static final String CURRENCY
public static final String DATE
public static final String TIME
| Constructor Detail |
|---|
public FormatUtil()
| Method Detail |
|---|
public static String format(Object pValue,
String pFormat,
Object pDefault,
Locale pLocale,
Properties pProps)
pValue - Value to be formattedpFormat - Name of the formatter to be used to format the valuepDefault - If the passed value is null, then this is used as the value to formatpLocale - Locale to be passed to the formatterpProps - Properties to be passed to the formatter (properties implementation dependant)
public static void addFormatter(String pName,
FormatIF pFormatter)
pName - Name of the formatter. With this name, the formatter is retrieved on use. If a formatter was already
registered with this name, then it will be overwritten.pFormatter - Instance of the formatter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||