|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Convertor
The purpose of a Convertor is to convert between Object and String
representations of the same thing. For example, convert
Long
s or Date
s to strings, and vice
versa. The behaviour of this conversion process can depend on the
user's Locale.
If you need to do mass conversion of a lot of values, it may be
beneficial to pass a Convertor.FormatCache
object to the convert methods.
Some convertors need to build and configure parser or formatting objects,
which can be expensive if it needs to be done repeatedly.
Nested Class Summary | |
---|---|
static interface |
Convertor.FormatCache
|
Method Summary | |
---|---|
ConversionResult |
convertFromString(String value,
Locale locale,
Convertor.FormatCache formatCache)
Converts string representation into the object of convertor's type. |
String |
convertToString(Object value,
Locale locale,
Convertor.FormatCache formatCache)
|
void |
generateSaxFragment(ContentHandler contentHandler,
Locale locale)
Generates a bit of information about this convertor (optional). |
Class |
getTypeClass()
|
Method Detail |
---|
ConversionResult convertFromString(String value, Locale locale, Convertor.FormatCache formatCache)
formatCache
- can be null if not neededString convertToString(Object value, Locale locale, Convertor.FormatCache formatCache)
Class getTypeClass()
void generateSaxFragment(ContentHandler contentHandler, Locale locale) throws SAXException
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |