- java.lang.Object
-
- javax.money.AbstractContext
-
- javax.money.format.AmountFormatContext
-
- All Implemented Interfaces:
java.io.Serializable
public final class AmountFormatContext extends AbstractContext
TheAmountFormatContextprovides details about aMonetaryAmountFormat.- See Also:
MonetaryAmountFormat.getContext(), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringKEY_FORMAT_NAMEKey used for the format name attribute.-
Fields inherited from class javax.money.AbstractContext
KEY_PROVIDER
-
-
Constructor Summary
Constructors Constructor Description AmountFormatContext(AmountFormatContextBuilder builder)Creates a new instance ofAmountFormatContext.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFormatName()Access the style'sLocale.java.util.LocalegetLocale()Access the context's Locale.MonetaryAmountFactory<?>getParseFactory()Access the format'sMonetaryAmountFactorythat is used to of new amounts during parsing.AmountFormatContextBuildertoBuilder()Creates a new builder instances, initialized with the data from this one.
-
-
-
Field Detail
-
KEY_FORMAT_NAME
static final java.lang.String KEY_FORMAT_NAME
Key used for the format name attribute.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AmountFormatContext
AmountFormatContext(AmountFormatContextBuilder builder)
Creates a new instance ofAmountFormatContext.- Parameters:
builder- the corresponding builder.
-
-
Method Detail
-
getFormatName
public java.lang.String getFormatName()
Access the style'sLocale.- Returns:
- the
Locale, nevernull.
-
getLocale
public java.util.Locale getLocale()
Access the context's Locale.- Returns:
- the Locale, or null.
-
getParseFactory
public MonetaryAmountFactory<?> getParseFactory()
Access the format'sMonetaryAmountFactorythat is used to of new amounts during parsing. If not set explicitly, the defaultMonetaryAmountFactoryis used.- Returns:
- the
MonetaryAmountFactory, nevernull.
-
toBuilder
public AmountFormatContextBuilder toBuilder()
Creates a new builder instances, initialized with the data from this one.- Returns:
- a new
AmountFormatContextBuilderinstance, never null.
-
-