java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.money.MonetaryException
javax.money.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 aCurrencyUnitcould not be evaluated given a currency code.UnknownCurrencyException(java.util.Locale locale)Creates a new exception instance when aCurrencyUnitcould not be evaluated given a (country)Locale. -
Method Summary
Modifier and Type Method Description java.lang.StringgetCurrencyCode()Access the invalid currency code.java.util.LocalegetLocale()Access the invalidLocale.java.lang.StringtoString()
-
Constructor Details
-
UnknownCurrencyException
public UnknownCurrencyException(java.lang.String code)Creates a new exception instance when aCurrencyUnitcould 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 aCurrencyUnitcould not be evaluated given a (country)Locale.- Parameters:
locale- The unknownLocale, for which aCurrencyUnitwas queried (the message is constructed automatically), not null.- See Also:
Monetary.getCurrency(Locale,String...)
-
-
Method Details
-
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 invalidLocale.- Returns:
- the invalid
Locale, ornull.
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Throwable
-