public class CompositeFormat
extends java.text.Format
Constructor and Description |
---|
CompositeFormat(java.text.Format parser,
java.text.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 |
---|---|
java.lang.StringBuffer |
format(java.lang.Object obj,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos)
Uses the formatter Format instance.
|
java.text.Format |
getFormatter()
Provides access to the parser Format implementation.
|
java.text.Format |
getParser()
Provides access to the parser Format implementation.
|
java.lang.Object |
parseObject(java.lang.String source,
java.text.ParsePosition pos)
Uses the parser Format instance.
|
java.lang.String |
reformat(java.lang.String input)
Utility method to parse and then reformat a String.
|
public CompositeFormat(java.text.Format parser, java.text.Format formatter)
parser
- implementationformatter
- implementationpublic java.lang.StringBuffer format(java.lang.Object obj, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.Format
obj
- the object to formattoAppendTo
- the StringBuffer
to append topos
- the FieldPosition to use (or ignore).toAppendTo
Format.format(Object, StringBuffer, FieldPosition)
public java.lang.Object parseObject(java.lang.String source, java.text.ParsePosition pos)
parseObject
in class java.text.Format
source
- 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 java.text.Format getParser()
public java.text.Format getFormatter()
public java.lang.String reformat(java.lang.String input) throws java.text.ParseException
input
- String to reformatjava.text.ParseException
- thrown by parseObject(String) callCopyright © 2010 - 2020 Adobe. All Rights Reserved