Package java.util.spi

Class CurrencyNameProvider

java.lang.Object
java.util.spi.LocaleServiceProvider
java.util.spi.CurrencyNameProvider

public abstract class CurrencyNameProvider
extends LocaleServiceProvider
This abstract class should be extended by service providers that provide localized currency symbols (currency names) from currency codes.

Note that Android does not support user-supplied locale service providers.

Since:
1.6
  • Constructor Details

    • CurrencyNameProvider

      protected CurrencyNameProvider()
      Default constructor, for use by subclasses.
  • Method Details

    • getSymbol

      public abstract String getSymbol​(String code, Locale locale)
      Returns the localized currency symbol for the given currency code.
      Parameters:
      code - an ISO 4217 currency code
      locale - a locale
      Returns:
      the symbol or null if there is no available symbol in the locale
      Throws:
      NullPointerException - if code == null || locale == null
      IllegalArgumentException - if code or locale is not in a legal format or not available