|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeHandler
A TypeHandler is used to convert field text into a Java object and vice versa.
Implementations should be thread-safe if multiple threads may concurrently process the same stream type. All included BeanIO type handlers are thread safe.
Field Summary | |
---|---|
static String |
NIL
This constant can be returned from format(Object) for XML formatted streams to indicate
a nillable element should be set to nil even if the field's minimum occurrences is zero. |
Method Summary | |
---|---|
String |
format(Object value)
Formats a Java object into field text. |
Class<?> |
getType()
Returns the class type supported by this handler. |
Object |
parse(String text)
Parses field text into a Java object. |
Field Detail |
---|
static final String NIL
format(Object)
for XML formatted streams to indicate
a nillable element should be set to nil even if the field's minimum occurrences is zero.
In all other cases, if NIL is returned, the formatted value is treated as null.
Method Detail |
---|
Object parse(String text) throws TypeConversionException
text
- the field text to parse, which may be null if the field was not passed in the record
TypeConversionException
- if the text cannot be parsedString format(Object value)
value
- the Java object to format, which may be null
NIL
for XML formatted streamsClass<?> getType()
|
BeanIO 1.2.3 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |