Top Description Methods
javax.money.spi

public Interface MonetaryFormatsSingletonSpi

Known Direct Implementers
javax.money.format.MonetaryFormats.DefaultMonetaryFormatsSingletonSpi
Imports
javax.money.MonetaryException, javax.money.format.AmountFormatQuery, .AmountFormatQueryBuilder, .MonetaryAmountFormat, java.util.*

This interface models the singleton functionality of javax.money.format.MonetaryFormats.

Implementations of this interface must be thread-safe.

Authors
Anatole Tresch, Werner Keil

Method Summary

Modifier and TypeMethod and Description
public default MonetaryAmountFormat

Returns:

the corresponding javax.money.format.MonetaryAmountFormat
getAmountFormat
(AmountFormatQuery
The format query defining the requirements of the formatter.
formatQuery
)

Access an javax.money.format.MonetaryAmountFormat given a .AmountFormatQuery.

public default MonetaryAmountFormat

Returns:

the matching MonetaryAmountFormat
getAmountFormat
(Locale
the target Locale, not null.
locale
,
String...
The (optional) providers to be used, ordered correspondingly.
providers
)

Access the default MonetaryAmountFormat given a Locale.

public default MonetaryAmountFormat

Returns:

the matching MonetaryAmountFormat
getAmountFormat
(String
the target format name, not null.
formatName
,
String...
The (optional) providers to be used, ordered correspondingly.
providers
)

Access the default MonetaryAmountFormat given a Locale.

public Collection<MonetaryAmountFormat>

Returns:

the corresponding javax.money.format.MonetaryAmountFormat instances, never null
getAmountFormats
(AmountFormatQuery
The format query defining the requirements of the formatter.
formatQuery
)

Access all javax.money.format.MonetaryAmountFormat instances matching the given .AmountFormatQuery.

public Set<Locale>

Returns:

all available locales, never null.
getAvailableLocales
(String...
The (optional) providers to be used, ordered correspondingly.
providers
)

Get all available locales.

public List<String>

Returns:

the default provider chain, never null.
getDefaultProviderChain
()

Get the default provider chain, identified by the unique provider names in order as evaluated and used.

public Set<String>

Returns:

the provider names, never null.
getProviderNames
()

Get the names of the currently registered format providers.

public default boolean

Returns:

true, if a t least one javax.money.format.MonetaryAmountFormat is matching the query.
isAvailable
(AmountFormatQuery
The format query defining the requirements of the formatter.
formatQuery
)

Checks if a javax.money.format.MonetaryAmountFormat is available given a .AmountFormatQuery.

public default boolean

Returns:

true, if a t least one javax.money.format.MonetaryAmountFormat is matching the query.
isAvailable
(Locale
the target Locale, not null.
locale
,
String...
The (optional) providers to be used, ordered correspondingly.
providers
)

Checks if a javax.money.format.MonetaryAmountFormat is available given a .AmountFormatQuery.

Method Detail

getAmountFormatback to summary
public default MonetaryAmountFormat getAmountFormat(AmountFormatQuery formatQuery)

Access an javax.money.format.MonetaryAmountFormat given a .AmountFormatQuery.

Parameters
formatQuery:AmountFormatQuery

The format query defining the requirements of the formatter.

Returns:MonetaryAmountFormat

the corresponding javax.money.format.MonetaryAmountFormat

Exceptions
MonetaryException:
if no registered .MonetaryAmountFormatProviderSpi can provide a corresponding javax.money.format.MonetaryAmountFormat instance.
getAmountFormatback to summary
public default MonetaryAmountFormat getAmountFormat(Locale locale, String... providers)

Access the default MonetaryAmountFormat given a Locale.

Parameters
locale:Locale

the target Locale, not null.

providers:String[]

The (optional) providers to be used, ordered correspondingly.

Returns:MonetaryAmountFormat

the matching MonetaryAmountFormat

Exceptions
MonetaryException:
if no registered MonetaryAmountFormatProviderSpi can provide a corresponding MonetaryAmountFormat instance.
getAmountFormatback to summary
public default MonetaryAmountFormat getAmountFormat(String formatName, String... providers)

Access the default MonetaryAmountFormat given a Locale.

Parameters
formatName:String

the target format name, not null.

providers:String[]

The (optional) providers to be used, ordered correspondingly.

Returns:MonetaryAmountFormat

the matching MonetaryAmountFormat

Exceptions
MonetaryException:
if no registered MonetaryAmountFormatProviderSpi can provide a corresponding MonetaryAmountFormat instance.
getAmountFormatsback to summary
public Collection<MonetaryAmountFormat> getAmountFormats(AmountFormatQuery formatQuery)

Access all javax.money.format.MonetaryAmountFormat instances matching the given .AmountFormatQuery.

Parameters
formatQuery:AmountFormatQuery

The format query defining the requirements of the formatter.

Returns:Collection<MonetaryAmountFormat>

the corresponding javax.money.format.MonetaryAmountFormat instances, never null

getAvailableLocalesback to summary
public Set<Locale> getAvailableLocales(String... providers)

Get all available locales. This equals to MonetaryAmountFormatProviderSpi#getAvailableLocales().

Parameters
providers:String[]

The (optional) providers to be used, ordered correspondingly.

Returns:Set<Locale>

all available locales, never null.

getDefaultProviderChainback to summary
public List<String> getDefaultProviderChain()

Get the default provider chain, identified by the unique provider names in order as evaluated and used.

Returns:List<String>

the default provider chain, never null.

getProviderNamesback to summary
public Set<String> getProviderNames()

Get the names of the currently registered format providers.

Returns:Set<String>

the provider names, never null.

isAvailableback to summary
public default boolean isAvailable(AmountFormatQuery formatQuery)

Checks if a javax.money.format.MonetaryAmountFormat is available given a .AmountFormatQuery.

Parameters
formatQuery:AmountFormatQuery

The format query defining the requirements of the formatter.

Returns:boolean

true, if a t least one javax.money.format.MonetaryAmountFormat is matching the query.

isAvailableback to summary
public default boolean isAvailable(Locale locale, String... providers)

Checks if a javax.money.format.MonetaryAmountFormat is available given a .AmountFormatQuery.

Parameters
locale:Locale

the target Locale, not null.

providers:String[]

The (optional) providers to be used, ordered correspondingly.

Returns:boolean

true, if a t least one javax.money.format.MonetaryAmountFormat is matching the query.