public class CompositeFormat extends Format
Format.Field| Constructor and Description |
|---|
CompositeFormat(Format parser,
Format formatter)
Create a format that points its parseObject method to one implementation
and its format method to another.
|
| Modifier and Type | Method and Description |
|---|---|
StringBuffer |
format(Object obj,
StringBuffer toAppendTo,
FieldPosition pos)
Uses the formatter Format instance.
|
Format |
getFormatter()
Provides access to the parser Format implementation.
|
Format |
getParser()
Provides access to the parser Format implementation.
|
Object |
parseObject(String source,
ParsePosition pos)
Uses the parser Format instance.
|
String |
reformat(String input)
Utility method to parse and then reformat a String.
|
clone, format, formatToCharacterIterator, parseObjectpublic StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos)
format in class Formatobj - the object to formattoAppendTo - the StringBuffer to append topos - the FieldPosition to use (or ignore).toAppendToFormat.format(Object, StringBuffer, FieldPosition)public Object parseObject(String source, ParsePosition pos)
parseObject in class Formatsource - the String sourcepos - the ParsePosition containing the position to parse from, will
be updated according to parsing success (index) or failure
(error index)Format.parseObject(String, ParsePosition)public Format getParser()
public Format getFormatter()
public String reformat(String input) throws ParseException
input - String to reformatParseException - thrown by parseObject(String) callCopyright © 2021 Internet2. All rights reserved.