Module java.money
Package javax.money

Class UnknownCurrencyException

  • All Implemented Interfaces:
    java.io.Serializable

    public class UnknownCurrencyException
    extends MonetaryException
    Exception thrown when a currency code cannot be resolved into a CurrencyUnit.
    Version:
    0.8
    Author:
    Werner Keil, Anatole Tresch
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      UnknownCurrencyException​(java.lang.String code)
      Creates a new exception instance when a CurrencyUnit could not be evaluated given a currency code.
      UnknownCurrencyException​(java.util.Locale locale)
      Creates a new exception instance when a CurrencyUnit could not be evaluated given a (country) Locale.
    • Method Summary

      Modifier and Type Method Description
      java.lang.String getCurrencyCode()
      Access the invalid currency code.
      java.util.Locale getLocale()
      Access the invalid Locale.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

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

      • UnknownCurrencyException

        public UnknownCurrencyException​(java.lang.String code)
        Creates a new exception instance when a CurrencyUnit could not be evaluated given a currency code.
        Parameters:
        code - The unknown currency code (the message is constructed automatically), not null.
        See Also:
        Monetary.getCurrency(String, String...)
      • UnknownCurrencyException

        public UnknownCurrencyException​(java.util.Locale locale)
        Creates a new exception instance when a CurrencyUnit could not be evaluated given a (country) Locale.
        Parameters:
        locale - The unknown Locale, for which a CurrencyUnit was queried (the message is constructed automatically), not null.
        See Also:
        Monetary.getCurrency(Locale,String...)
    • Method Detail

      • getCurrencyCode

        public java.lang.String getCurrencyCode()
        Access the invalid currency code.
        Returns:
        the invalid currency code, or null.
      • getLocale

        public java.util.Locale getLocale()
        Access the invalid Locale.
        Returns:
        the invalid Locale, or null.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Throwable