Class ConverterCurrency
java.lang.Object
com.opencsv.bean.AbstractCsvConverter
com.opencsv.bean.ConverterCurrency
- All Implemented Interfaces:
CsvConverter
This class converts an input ISO 4217 currency code to a
Currency
instance.- Since:
- 5.3
-
Field Summary
Fields inherited from class AbstractCsvConverter
errorLocale, locale, type, writeLocale -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToRead(String value) Method for converting from a string to the proper data type of the destination field.convertToWrite(Object value) ConvertsCurrencyinstance to a string.Methods inherited from class AbstractCsvConverter
setErrorLocale, setLocale, setType, setWriteLocale
-
Constructor Details
-
ConverterCurrency
Initializes the class.- Parameters:
errorLocale- The locale to use for error messages
-
-
Method Details
-
convertToRead
Description copied from interface:CsvConverterMethod for converting from a string to the proper data type of the destination field.- Parameters:
value- The ISO 4217 currency code string to be converted- Returns:
Currencyinstance- Throws:
CsvDataTypeMismatchException- If the input string cannot be converted into the proper type
-
convertToWrite
ConvertsCurrencyinstance to a string.- Specified by:
convertToWritein interfaceCsvConverter- Overrides:
convertToWritein classAbstractCsvConverter- Parameters:
value- TheCurrencyinstance- Returns:
- ISO 4217 currency code or
nullif value wasnull - Throws:
CsvDataTypeMismatchException- If the value is not aCurrency
-