CsvNumber, that is,
when number inputs and outputs should be formatted.
| Modifier and Type | Field and Description |
|---|---|
| private final UnaryOperator | |
| private final DecimalFormat | |
| private final DecimalFormat |
| Access | Constructor and Description |
|---|---|
| public | ConverterNumber(Class<?>
The class of the type of the data being processed type, String If not null or empty, specifies the locale used for
converting locale-specific data types for reading locale, String If not null or empty, specifies the locale used for
converting locale-specific data types for writing writeLocale, Locale The locale to use for error messages errorLocale, String The string to use for parsing the number. readFormat, String The string to use for formatting the number. writeFormat, RoundingMode The rounding mode used when converting roundingMode)java.s.
|
| Modifier and Type | Method and Description |
|---|---|
| public Object | convertToRead(String value)
Implements com. Method for converting from a string to the proper data type of the destination field. |
| public String | convertToWrite(Object value)
Overrides com. Implements com. Formats the number in question according to the pattern that has been provided. |
| private DecimalFormat |
| readConversionFunction | back to summary |
|---|---|
| private final UnaryOperator<Number> readConversionFunction | |
| readFormatter | back to summary |
|---|---|
| private final DecimalFormat readFormatter | |
| writeFormatter | back to summary |
|---|---|
| private final DecimalFormat writeFormatter | |
| ConverterNumber | back to summary |
|---|---|
public ConverterNumber(Class<?> type, String locale, String writeLocale, Locale errorLocale, String readFormat, String writeFormat, RoundingMode roundingMode) throws CsvBadConverterException
| |
| convertToRead | back to summary |
|---|---|
| public Object convertToRead(String value) throws CsvDataTypeMismatchException Implements com. Doc from com. Method for converting from a string to the proper data type of the destination field.
| |
| convertToWrite | back to summary |
|---|---|
| public String convertToWrite(Object value) throws CsvDataTypeMismatchException Overrides com. Implements com. Formats the number in question according to the pattern that has been provided.
| |
| createDecimalFormat | back to summary |
|---|---|
| private DecimalFormat createDecimalFormat(String format, Locale locale, RoundingMode roundingMode) | |