Class OceanusDataFormatter
java.lang.Object
io.github.tonywasher.joceanus.oceanus.format.OceanusDataFormatter
Data Formatter.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFormatter extension. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClear accounting mode.voidExtend the formatter.formatObject(Object pValue) Format an object value.Obtain the date formatter.Obtain the decimal formatter.Obtain the decimal parser.Obtain the locale.<T> TparseValue(Double pSource, Class<T> pClazz) Parse object value.<T> TparseValue(Double pSource, String pCurrCode, Class<T> pClazz) Parse object value.<T> TparseValue(String pSource, Class<T> pClazz) Parse object value.voidsetAccountingWidth(int pWidth) Set accounting width.final voidSet the date format.final voidSet the locale.
-
Constructor Details
-
OceanusDataFormatter
public OceanusDataFormatter()Constructor. -
OceanusDataFormatter
Constructor.- Parameters:
pLocale- the locale
-
-
Method Details
-
getDateFormatter
Obtain the date formatter.- Returns:
- the formatter
-
getDecimalFormatter
Obtain the decimal formatter.- Returns:
- the formatter
-
getDecimalParser
Obtain the decimal parser.- Returns:
- the parser
-
extendFormatter
Extend the formatter.- Parameters:
pExtension- the extension
-
setAccountingWidth
public void setAccountingWidth(int pWidth) Set accounting width.- Parameters:
pWidth- the accounting width to use
-
clearAccounting
public void clearAccounting()Clear accounting mode. -
setFormat
Set the date format.- Parameters:
pFormat- the format string
-
setLocale
Set the locale.- Parameters:
pLocale- the locale
-
getLocale
Obtain the locale.- Returns:
- the locale
-
formatObject
Format an object value.- Parameters:
pValue- the object to format- Returns:
- the formatted value
-
parseValue
Parse object value.- Type Parameters:
T- the value type- Parameters:
pSource- the source valuepClazz- the value type class- Returns:
- the formatted value
- Throws:
IllegalArgumentException- on bad Date/Decimal formatNumberFormatException- on bad Integer format
-
parseValue
Parse object value.- Type Parameters:
T- the value type- Parameters:
pSource- the source valuepClazz- the value type class- Returns:
- the formatted value
- Throws:
IllegalArgumentException- on bad TethysDecimal format
-
parseValue
Parse object value.- Type Parameters:
T- the value type- Parameters:
pSource- the source valuepCurrCode- the currency codepClazz- the value type class- Returns:
- the formatted value
- Throws:
IllegalArgumentException- on bad TethysDecimal format
-