This class is mutable and intended for use by a single thread. A new instance is created for each parse.
| Modifier and Type | Field and Description |
|---|---|
| private BigDecimal | amount
The parsed amount. |
| private CurrencyUnit | currency
The parsed currency. |
| private Locale | locale
The locale to parse using. |
| private CharSequence | text
The text to parse. |
| private int | textErrorIndex
The text error index. |
| private int | textIndex
The text index. |
| Access | Constructor and Description |
|---|---|
| pack-priv | MoneyParseContext(Locale
the locale, not null locale, CharSequence the text to parse, not null text, int the current text index index)Constructor. |
| pack-priv | MoneyParseContext(Locale
the locale, not null locale, CharSequence the text to parse, not null text, int the current text index index, int the error index errorIndex, CurrencyUnit the currency currency, BigDecimal the parsed amount amount)Constructor. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv MoneyParseContext | |
| public BigDecimal | |
| public CurrencyUnit | |
| public int | |
| public int | |
| public Locale | |
| public CharSequence | |
| public int | Returns: the length of the text being parsedGets the length of the text being parsed. |
| public String | Returns: the substring, not nullthe start index start, int the end index end)Gets a substring of the text being parsed. |
| public boolean | Returns: true if able to create a monetary valueChecks if the context contains a currency and amount suitable for creating a monetary value. |
| public boolean | |
| public boolean | Returns: true if fully parsedChecks if the text has been fully parsed such that there is no more text to parse. |
| pack-priv void | mergeChild(MoneyParseContext
the child context, not null child)Merges the child context back into this instance. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public BigMoney | |
| public ParsePosition |
| amount | back to summary |
|---|---|
| private BigDecimal amount The parsed amount. | |
| currency | back to summary |
|---|---|
| private CurrencyUnit currency The parsed currency. | |
| locale | back to summary |
|---|---|
| private Locale locale The locale to parse using. | |
| text | back to summary |
|---|---|
| private CharSequence text The text to parse. | |
| textErrorIndex | back to summary |
|---|---|
| private int textErrorIndex The text error index. | |
| textIndex | back to summary |
|---|---|
| private int textIndex The text index. | |
| MoneyParseContext | back to summary |
|---|---|
| pack-priv MoneyParseContext(Locale locale, CharSequence text, int index) Constructor.
| |
| MoneyParseContext | back to summary |
|---|---|
| pack-priv MoneyParseContext(Locale locale, CharSequence text, int index, int errorIndex, CurrencyUnit currency, BigDecimal amount) Constructor.
| |
| createChild | back to summary |
|---|---|
| pack-priv MoneyParseContext createChild() Creates a child context.
| |
| getAmount | back to summary |
|---|---|
| public BigDecimal getAmount() Gets the parsed amount.
| |
| getCurrency | back to summary |
|---|---|
| public CurrencyUnit getCurrency() Gets the parsed currency.
| |
| getErrorIndex | back to summary |
|---|---|
| public int getErrorIndex() Gets the error index.
| |
| getIndex | back to summary |
|---|---|
| public int getIndex() Gets the current parse position index.
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Gets the locale.
| |
| getText | back to summary |
|---|---|
| public CharSequence getText() Gets the text being parsed.
| |
| getTextLength | back to summary |
|---|---|
| public int getTextLength() Gets the length of the text being parsed.
| |
| getTextSubstring | back to summary |
|---|---|
| public String getTextSubstring(int start, int end) Gets a substring of the text being parsed.
| |
| isComplete | back to summary |
|---|---|
| public boolean isComplete() Checks if the context contains a currency and amount suitable for creating a monetary value.
| |
| isError | back to summary |
|---|---|
| public boolean isError() Checks if the parse has found an error.
| |
| isFullyParsed | back to summary |
|---|---|
| public boolean isFullyParsed() Checks if the text has been fully parsed such that there is no more text to parse.
| |
| mergeChild | back to summary |
|---|---|
| pack-priv void mergeChild(MoneyParseContext child) Merges the child context back into this instance.
| |
| setAmount | back to summary |
|---|---|
| public void setAmount(BigDecimal amount) Sets the parsed currency.
| |
| setCurrency | back to summary |
|---|---|
| public void setCurrency(CurrencyUnit currency) Sets the parsed currency.
| |
| setError | back to summary |
|---|---|
| public void setError() Sets the error index from the current index. | |
| setErrorIndex | back to summary |
|---|---|
| public void setErrorIndex(int index) Sets the error index.
| |
| setIndex | back to summary |
|---|---|
| public void setIndex(int index) Sets the current parse position index.
| |
| setLocale | back to summary |
|---|---|
| public void setLocale(Locale locale) Sets the locale.
| |
| setText | back to summary |
|---|---|
| public void setText(CharSequence text) Sets the text.
| |
| toBigMoney | back to summary |
|---|---|
| public BigMoney toBigMoney() Converts the context to a
| |
| toParsePosition | back to summary |
|---|---|
| public ParsePosition toParsePosition() Converts the indexes to a parse position.
| |