Top Description Fields Constructors Methods
org.joda.money

pack-priv Class DefaultCurrencyUnitDataProvider

extends CurrencyUnitDataProvider
Class Inheritance
Imports
java.io.BufferedReader, .FileNotFoundException, .InputStreamReader, java.util.ArrayList, .List, java.util.regex.Pattern

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 named META-INF/org/joda/money/CountryDataExtension.csv. These will be read using ClassLoader#getResources(String). These files may augment or replace data from the first two files.

Field Summary

Modifier and TypeField and Description
private static final Pattern
COUNTRY_REGEX_LINE

Regex format for the country csv line.

private static final Pattern
CURRENCY_REGEX_LINE

Regex format for the money csv line.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private List<String>
loadFromFile(String fileName)

private List<String>
private void
private void
protected void
registerCurrencies()

Implements abstract org.joda.money.CurrencyUnitDataProvider.registerCurrencies.

Registers all the currencies known by this provider.

Inherited from org.joda.money.CurrencyUnitDataProvider:
registerCountryregisterCurrency

Field Detail

COUNTRY_REGEX_LINEback to summary
private static final Pattern COUNTRY_REGEX_LINE

Regex format for the country csv line.

CURRENCY_REGEX_LINEback to summary
private static final Pattern CURRENCY_REGEX_LINE

Regex format for the money csv line.

Constructor Detail

DefaultCurrencyUnitDataProviderback to summary
pack-priv DefaultCurrencyUnitDataProvider()

Method Detail

loadFromFileback to summary
private List<String> loadFromFile(String fileName) throws Exception
loadFromFilesback to summary
private List<String> loadFromFiles(String fileName) throws Exception
parseCountriesback to summary
private void parseCountries(List<String> content) throws Exception
parseCurrenciesback to summary
private void parseCurrencies(List<String> content) throws Exception
registerCurrenciesback to summary
protected void registerCurrencies() throws Exception

Implements abstract org.joda.money.CurrencyUnitDataProvider.registerCurrencies.

Registers all the currencies known by this provider.

Annotations
@Override
Exceptions
Exception:
if an error occurs