public interface RecordParserFactory
The Java object bound to a record depends on the stream format. The following table shows the object used for each format:
| Format | Record Type |
|---|---|
| Fixed Length | String |
| CSV, Delimited | String[] |
| XML | Document |
The following table shows the method invoked for a requested BeanIO interface.
| Requests For | Invokes |
|---|---|
BeanReader |
createReader(Reader) |
BeanWriter |
createWriter(Writer) |
Unmarshaller |
createUnmarshaller() |
Marshaller |
createMarshaller() |
A RecordParserFactory implementation must be thread safe (after all of its properties have been set).
RecordReader,
RecordWriter,
RecordMarshaller,
RecordUnmarshaller| Modifier and Type | Method and Description |
|---|---|
RecordMarshaller |
createMarshaller()
Creates a parser for marshalling records.
|
RecordReader |
createReader(Reader in)
Creates a parser for reading records from an input stream.
|
RecordUnmarshaller |
createUnmarshaller()
Creates a parser for unmarshalling records.
|
RecordWriter |
createWriter(Writer out)
Creates a parser for writing records to an output stream.
|
void |
init()
Initializes the factory.
|
void init() throws IllegalArgumentException
IllegalArgumentException - if the parser configuration is invalidRecordReader createReader(Reader in) throws IllegalArgumentException
in - the input stream to read fromRecordReaderIllegalArgumentException - if this factory is improperly configured
and a RecordReader cannot be createdRecordWriter createWriter(Writer out) throws IllegalArgumentException
out - the output stream to write toRecordWriterIllegalArgumentException - if this factory is improperly configured
and a RecordWriter cannot be createdRecordMarshaller createMarshaller() throws IllegalArgumentException
RecordMarshallerIllegalArgumentException - if this factory is improperly configured and
a RecordMarshaller cannot be createdRecordUnmarshaller createUnmarshaller() throws IllegalArgumentException
RecordUnmarshallerIllegalArgumentException - if this factory is improperly configured and
a RecordUnmarshaller cannot be created