| Modifier and Type | Field and Description |
|---|---|
| private final AmountFormatContext | context
The current conversion context. |
| private final Locale | locale
The target locale. |
| private CurrencyStyle | style
The style defining, how the currency should be localized. |
| Access | Constructor and Description |
|---|---|
| pack-priv | CurrencyToken(CurrencyStyle
The style defining, how the currency should be localized, not
style, AmountFormatContext null.The target context, not context)null.Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| private Currency | Returns: the corresponding currency instance, or null.the currency code , not null. currencyCode)Method to safely access a |
| private String | Returns: the formatted currency name.The currency, not currency)nullThis method tries to evaluate the localized display name for a
|
| public CurrencyStyle | |
| private String | Returns: the formatted currency symbol.The currency, not currency)nullThis method tries to evaluate the localized symbol name for a
|
| private String | Returns: the formatted currency.the amount)MonetaryAmount containing the CurrencyUnit
to be formatted.Evaluate the formatted(localized) token. |
| public void | parse(ParseContext context)
Implements org. Parses a currency from the given |
| private String | Returns: the first letter based part, or the full token.the input token token)Tries to split up a letter based first part, e.g. for evaluating a ISO currency code from an input as 'CHF100.34'. |
| public void | print(Appendable appendable, MonetaryAmount amount)
Implements org. Prints the |
| public CurrencyToken | Returns: this token instance, for chaining.the style)CurrencyStyle, not null.Explicitly configure the |
| public String |
| context | back to summary |
|---|---|
| private final AmountFormatContext context The current conversion context. | |
| locale | back to summary |
|---|---|
| private final Locale locale The target locale. | |
| style | back to summary |
|---|---|
| private CurrencyStyle style The style defining, how the currency should be localized. | |
| CurrencyToken | back to summary |
|---|---|
| pack-priv CurrencyToken(CurrencyStyle style, AmountFormatContext context) Creates a new
| |
| getCurrency | back to summary |
|---|---|
| private Currency getCurrency(String currencyCode) Method to safely access a | |
| getCurrencyName | back to summary |
|---|---|
| private String getCurrencyName(CurrencyUnit currency) This method tries to evaluate the localized display name for a
If not found
| |
| getCurrencyStyle | back to summary |
|---|---|
| public CurrencyStyle getCurrencyStyle() Access the
| |
| getCurrencySymbol | back to summary |
|---|---|
| private String getCurrencySymbol(CurrencyUnit currency) This method tries to evaluate the localized symbol name for a
If not found
| |
| getToken | back to summary |
|---|---|
| private String getToken(MonetaryAmount amount) Evaluate the formatted(localized) token.
| |
| parse | back to summary |
|---|---|
| public void parse(ParseContext context) throws MonetaryParseException Implements org. Parses a currency from the given
| |
| parseCurrencyCode | back to summary |
|---|---|
| private String parseCurrencyCode(String token) Tries to split up a letter based first part, e.g. for evaluating a ISO currency code from an input as 'CHF100.34'. | |
| back to summary | |
|---|---|
| public void print(Appendable appendable, MonetaryAmount amount) throws IOException Implements org. Prints the
| |
| setCurrencyStyle | back to summary |
|---|---|
| public CurrencyToken setCurrencyStyle(CurrencyStyle style) Explicitly configure the
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |