org.apache.commons.lang.text
public class CompositeFormat extends Format
Version: $Id: CompositeFormat.java 598710 2007-11-27 17:34:34Z mbenson $
Constructor Summary | |
---|---|
CompositeFormat(Format parser, Format formatter)
Create a format that points its parseObject method to one implementation
and its format method to another.
|
Method Summary | |
---|---|
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.
|
Parameters: parser implementation formatter implementation
Parameters: obj the object to format toAppendTo the StringBuffer to append to pos the FieldPosition to use (or ignore).
Returns: toAppendTo
See Also: Format#format(Object, StringBuffer, FieldPosition)
Returns: formatter Format implementation
Returns: parser Format implementation
Parameters: source the String source pos the ParsePosition containing the position to parse from, will be updated according to parsing success (index) or failure (error index)
Returns: the parsed Object
See Also: Format#parseObject(String, ParsePosition)
Parameters: input String to reformat
Returns: A reformatted String
Throws: ParseException thrown by parseObject(String) call