Top Description Fields Constructors Methods
javax.money

public Class UnknownCurrencyException

extends MonetaryException
Class Inheritance
Imports
java.util.Locale, .Objects

Exception thrown when a currency code cannot be resolved into a CurrencyUnit.
Authors
Werner Keil, Anatole Tresch
Version
0.8

Field Summary

Modifier and TypeField and Description
private final String
currencyCode

The invalid currency code requested.

private final Locale
locale

The invalid Locale requested.

private static final long

Constructor Summary

AccessConstructor and Description
public
UnknownCurrencyException(String
The unknown currency code (the message is constructed automatically), not null.
code
)

Creates a new exception instance when a CurrencyUnit could not be evaluated given a currency code.

public
UnknownCurrencyException(Locale
The unknown Locale, for which a CurrencyUnit was queried (the message is constructed automatically), not null.
locale
)

Creates a new exception instance when a CurrencyUnit could not be evaluated given a (country) Locale.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the invalid currency code, or null.
getCurrencyCode
()

Access the invalid currency code.

public Locale

Returns:

the invalid Locale, or null.
getLocale
()

Access the invalid Locale.

public String
toString()

Overrides java.lang.Throwable.toString.

Returns a short description of this throwable.

Field Detail

currencyCodeback to summary
private final String currencyCode

The invalid currency code requested.

localeback to summary
private final Locale locale

The invalid Locale requested.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.money.MonetaryException.serialVersionUID.

serialVersionUID.

Constructor Detail

UnknownCurrencyExceptionback to summary
public UnknownCurrencyException(String code)

Creates a new exception instance when a CurrencyUnit could not be evaluated given a currency code.

Parameters
code:String

The unknown currency code (the message is constructed automatically), not null.

See Also
Monetary#getCurrency(String, String...)
UnknownCurrencyExceptionback to summary
public UnknownCurrencyException(Locale locale)

Creates a new exception instance when a CurrencyUnit could not be evaluated given a (country) Locale.

Parameters
locale: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

getCurrencyCodeback to summary
public String getCurrencyCode()

Access the invalid currency code.

Returns:String

the invalid currency code, or null.

getLocaleback to summary
public Locale getLocale()

Access the invalid Locale.

Returns:Locale

the invalid Locale, or null.

toStringback to summary
public String toString()

Overrides java.lang.Throwable.toString.

Doc from java.lang.Throwable.toString.

Returns a short description of this throwable. The result is the concatenation of:

  • the name of the class of this object
  • ": " (a colon and a space)
  • the result of invoking this object's getLocalizedMessage method
If getLocalizedMessage returns null, then just the class name is returned.
Returns:String

a string representation of this throwable.

Annotations
@Override