Package org.joda.money
Class DefaultCurrencyUnitDataProvider
- java.lang.Object
-
- org.joda.money.CurrencyUnitDataProvider
-
- org.joda.money.DefaultCurrencyUnitDataProvider
-
class DefaultCurrencyUnitDataProvider extends CurrencyUnitDataProvider
Provider for available currencies using a file.This reads currencies from various files. Firstly it reads the mandatory resource named
/org/joda/money/CurencyData.csv. Then it reads the mandatory resource named/org/joda/money/CountryData.csv. These files are located in the joda-money jar file.Then it reads optional resources named
META-INF/org/joda/money/CurencyDataExtension.csv. Then it reads optional resources namedMETA-INF/org/joda/money/CountryDataExtension.csv. These will be read usingClassLoader.getResources(String). These files may augment or replace data from the first two files.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternCOUNTRY_REGEX_LINERegex format for the country csv line.private static java.util.regex.PatternCURRENCY_REGEX_LINERegex format for the money csv line.
-
Constructor Summary
Constructors Constructor Description DefaultCurrencyUnitDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.util.List<java.lang.String>loadFromFile(java.lang.String fileName)private java.util.List<java.lang.String>loadFromFiles(java.lang.String fileName)private voidparseCountries(java.util.List<java.lang.String> content)private voidparseCurrencies(java.util.List<java.lang.String> content)protected voidregisterCurrencies()Registers all the currencies known by this provider.-
Methods inherited from class org.joda.money.CurrencyUnitDataProvider
registerCountry, registerCurrency
-
-
-
-
Method Detail
-
registerCurrencies
protected void registerCurrencies() throws java.lang.ExceptionRegisters all the currencies known by this provider.- Specified by:
registerCurrenciesin classCurrencyUnitDataProvider- Throws:
java.lang.Exception- if an error occurs
-
loadFromFile
private java.util.List<java.lang.String> loadFromFile(java.lang.String fileName) throws java.lang.Exception- Throws:
java.lang.Exception
-
loadFromFiles
private java.util.List<java.lang.String> loadFromFiles(java.lang.String fileName) throws java.lang.Exception- Throws:
java.lang.Exception
-
parseCurrencies
private void parseCurrencies(java.util.List<java.lang.String> content) throws java.lang.Exception- Throws:
java.lang.Exception
-
parseCountries
private void parseCountries(java.util.List<java.lang.String> content) throws java.lang.Exception- Throws:
java.lang.Exception
-
-