MessageFormat.parse
Class Overview | Class Members |
This Package |
All Packages
public Object[] parse( String source,
ParsePosition status )
Description
Parses the string.
Caveats: The parse may fail in a number of circumstances.
For example:
- If one of the arguments does not occur in the pattern.
- If the format of an argument is loses information, such as
with a choice format where a large number formats to "many".
- Does not yet handle recursion (where
the substituted strings contain {n} references.)
- Will not always find a match (or the correct match)
if some part of the parse is ambiguous.
For example, if the pattern "{1},{2}" is used with the
string arguments {"a,b", "c"}, it will format as "a,b,c".
When the result is parsed, it will return {"a", "b,c"}.
- If a single argument is formatted twice in the string,
then the later parse wins.
public Object[] parse( String source ) throws ParseException
Description
Parses the string. Does not yet handle recursion (where
the substituted strings contain {n} references.)
Exceptions
ParseException
if the string can't be parsed.