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 forStreamFormatimplementations.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description StreamFormatSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RecordMarshallercreateRecordMarshaller()Creates a new record marshaller.RecordReadercreateRecordReader(java.io.Reader in)Creates a newRecordReaderto read from the given input stream.RecordUnmarshallercreateRecordUnmarshaller()Creates a new record unmarshaller.RecordWritercreateRecordWriter(java.io.Writer out)Creates a newRecordWriterfor writing to the given output stream.java.lang.StringgetName()Returns the name of the stream.protected RecordParserFactorygetRecordParserFactory()Returns theRecordParserFactoryused by this stream.voidsetName(java.lang.String name)Sets the name of this stream.voidsetRecordParserFactory(RecordParserFactory recordParserFactory)Sets theRecordParserFactoryfor 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:StreamFormatReturns the name of the stream.- Specified by:
getNamein interfaceStreamFormat- Returns:
- the stream name
-
createRecordReader
public RecordReader createRecordReader(java.io.Reader in)
Creates a newRecordReaderto read from the given input stream. This method delegates to the configured record parser factory.- Specified by:
createRecordReaderin interfaceStreamFormat- Parameters:
in- the input stream to read from- Returns:
- a new
RecordReader
-
createRecordWriter
public RecordWriter createRecordWriter(java.io.Writer out)
Creates a newRecordWriterfor writing to the given output stream. This method delegates to the configured record parser factory.- Specified by:
createRecordWriterin interfaceStreamFormat- Parameters:
out- the output stream to write to- Returns:
- a new
RecordWriter
-
createRecordMarshaller
public RecordMarshaller createRecordMarshaller()
Description copied from interface:StreamFormatCreates a new record marshaller.- Specified by:
createRecordMarshallerin interfaceStreamFormat- Returns:
- the new
RecordMarshaller
-
createRecordUnmarshaller
public RecordUnmarshaller createRecordUnmarshaller()
Description copied from interface:StreamFormatCreates a new record unmarshaller.- Specified by:
createRecordUnmarshallerin interfaceStreamFormat- Returns:
- the new
RecordUnmarshaller
-
setRecordParserFactory
public void setRecordParserFactory(RecordParserFactory recordParserFactory)
Sets theRecordParserFactoryfor creating record parsers.- Parameters:
recordParserFactory- theRecordParserFactory
-
getRecordParserFactory
protected RecordParserFactory getRecordParserFactory()
Returns theRecordParserFactoryused by this stream.- Returns:
- the
RecordParserFactory
-
-