Package org.beanio.internal.parser
Class StreamFormatSupport
- java.lang.Object
-
- org.beanio.internal.parser.StreamFormatSupport
-
- All Implemented Interfaces:
StreamFormat
- Direct Known Subclasses:
DelimitedStreamFormat
,FixedLengthStreamFormat
,JsonStreamFormat
,XmlStreamFormat
public abstract class StreamFormatSupport extends java.lang.Object implements StreamFormat
Base class forStreamFormat
implementations.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description StreamFormatSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordMarshaller
createRecordMarshaller()
Creates a new record marshaller.RecordReader
createRecordReader(java.io.Reader in)
Creates a newRecordReader
to read from the given input stream.RecordUnmarshaller
createRecordUnmarshaller()
Creates a new record unmarshaller.RecordWriter
createRecordWriter(java.io.Writer out)
Creates a newRecordWriter
for writing to the given output stream.java.lang.String
getName()
Returns the name of the stream.protected RecordParserFactory
getRecordParserFactory()
Returns theRecordParserFactory
used by this stream.void
setName(java.lang.String name)
Sets the name of this stream.void
setRecordParserFactory(RecordParserFactory recordParserFactory)
Sets theRecordParserFactory
for creating record parsers.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.beanio.internal.parser.StreamFormat
createMarshallingContext, createUnmarshallingContext
-
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Sets the name of this stream.- Parameters:
name
- the stream name
-
getName
public java.lang.String getName()
Description copied from interface:StreamFormat
Returns the name of the stream.- Specified by:
getName
in interfaceStreamFormat
- Returns:
- the stream name
-
createRecordReader
public RecordReader createRecordReader(java.io.Reader in)
Creates a newRecordReader
to read from the given input stream. This method delegates to the configured record parser factory.- Specified by:
createRecordReader
in interfaceStreamFormat
- Parameters:
in
- the input stream to read from- Returns:
- a new
RecordReader
-
createRecordWriter
public RecordWriter createRecordWriter(java.io.Writer out)
Creates a newRecordWriter
for writing to the given output stream. This method delegates to the configured record parser factory.- Specified by:
createRecordWriter
in interfaceStreamFormat
- Parameters:
out
- the output stream to write to- Returns:
- a new
RecordWriter
-
createRecordMarshaller
public RecordMarshaller createRecordMarshaller()
Description copied from interface:StreamFormat
Creates a new record marshaller.- Specified by:
createRecordMarshaller
in interfaceStreamFormat
- Returns:
- the new
RecordMarshaller
-
createRecordUnmarshaller
public RecordUnmarshaller createRecordUnmarshaller()
Description copied from interface:StreamFormat
Creates a new record unmarshaller.- Specified by:
createRecordUnmarshaller
in interfaceStreamFormat
- Returns:
- the new
RecordUnmarshaller
-
setRecordParserFactory
public void setRecordParserFactory(RecordParserFactory recordParserFactory)
Sets theRecordParserFactory
for creating record parsers.- Parameters:
recordParserFactory
- theRecordParserFactory
-
getRecordParserFactory
protected RecordParserFactory getRecordParserFactory()
Returns theRecordParserFactory
used by this stream.- Returns:
- the
RecordParserFactory
-
-