TextFormatter is used by I18NBundle to perform argument replacement.
| Modifier and Type | Field and Description |
|---|---|
| private StringBuilder | |
| private MessageFormat |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| private String | |
| private String | Returns: the formatted patternthe pattern pattern, Object... the arguments args)Formats the given |
| buffer | back to summary |
|---|---|
| private StringBuilder buffer | |
| messageFormat | back to summary |
|---|---|
| private MessageFormat messageFormat | |
| TextFormatter | back to summary |
|---|---|
| public TextFormatter(Locale locale, boolean useMessageFormat) | |
| format | back to summary |
|---|---|
| public String format(String pattern, Object... args) Formats the given
If this
On the contrary, if this In both cases, there's only one simple escaping rule, i.e. a left curly bracket must be doubled if you want it to be part of your string.
It's worth noting that the rules for using single quotes within
| |
| replaceEscapeChars | back to summary |
|---|---|
| private String replaceEscapeChars(String pattern) | |
| simpleFormat | back to summary |
|---|---|
| private String simpleFormat(String pattern, Object... args) Formats the given
This method only implements a small subset of the grammar supported by If nothing has been replaced this implementation returns the pattern itself.
| |