Class CurrencyUnitDataProvider

  • Direct Known Subclasses:
    DefaultCurrencyUnitDataProvider

    public abstract class CurrencyUnitDataProvider
    extends java.lang.Object
    Provider for available currencies.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void registerCountry​(java.lang.String countryCode, java.lang.String currencyCode)
      Registers a country allowing it to be used.
      protected abstract void registerCurrencies()
      Registers all the currencies known by this provider.
      protected void registerCurrency​(java.lang.String currencyCode, int numericCurrencyCode, int decimalPlaces)
      Registers a currency allowing it to be used.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CurrencyUnitDataProvider

        public CurrencyUnitDataProvider()
    • Method Detail

      • registerCurrencies

        protected abstract void registerCurrencies()
                                            throws java.lang.Exception
        Registers all the currencies known by this provider.
        Throws:
        java.lang.Exception - if an error occurs
      • registerCurrency

        protected final void registerCurrency​(java.lang.String currencyCode,
                                              int numericCurrencyCode,
                                              int decimalPlaces)
        Registers a currency allowing it to be used.

        This method is called by registerCurrencies() to perform the actual creation of a currency.

        Parameters:
        currencyCode - the currency code, not null
        numericCurrencyCode - the numeric currency code, -1 if none
        decimalPlaces - the number of decimal places that the currency normally has, from 0 to 3, or -1 for a pseudo-currency
      • registerCountry

        protected final void registerCountry​(java.lang.String countryCode,
                                             java.lang.String currencyCode)
        Registers a country allowing it to be used.

        This method is called by registerCurrencies() to perform the actual creation of a country.

        Parameters:
        countryCode - the country code, not null
        currencyCode - the currency code, not null