public interface FieldFormat
Field
parser.
Implementations of this interface must be thread-safe.
Modifier and Type | Method and Description |
---|---|
String |
extract(UnmarshallingContext context,
boolean reportErrors)
Extracts the field text from a record.
|
int |
getSize()
Returns the size of the field.
|
void |
insertField(MarshallingContext context,
String text)
Inserts field text into a record.
|
boolean |
insertValue(MarshallingContext context,
Object value)
Inserts a value into a record.
|
boolean |
isLazy()
TODO rename isLazy to something better??
Returns whether this field is optionally present in the record.
|
boolean |
isNillable()
Returns whether this field is nillable.
|
String extract(UnmarshallingContext context, boolean reportErrors)
May return Value.INVALID
if the field is invalid, or Value.NIL
if the field is explicitly set to nil or null such as in an XML or JSON formatted
stream.
Implementations should also remove any field padding before returning the text.
context
- the UnmarshallingContext
holding the recordboolean insertValue(MarshallingContext context, Object value)
insertField(MarshallingContext, String)
is called. If the method returns true, insertField(MarshallingContext, String)
is not invoked.context
- the MarshallingContext
value
- the value to insert into the recordinsertField(MarshallingContext, String)
must be invoked, false otherwisevoid insertField(MarshallingContext context, String text)
context
- the MarshallingContext
holding the recordtext
- the field text to insert into the recordint getSize()
boolean isNillable()
boolean isLazy()