Package org.beanio.internal.parser
Class Stream
- java.lang.Object
-
- org.beanio.internal.parser.Stream
-
public class Stream extends java.lang.Object- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static intREAD_ONLY_MODEStream definition supports reading onlystatic intREAD_WRITE_MODEStream definition supports reading and writingstatic intWRITE_ONLY_MODEStream definition supports writing only
-
Constructor Summary
Constructors Constructor Description Stream(StreamFormat format)Constructs a newStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeanReadercreateBeanReader(java.io.Reader in, java.util.Locale locale)Creates a newBeanReaderfor reading from the given input stream.BeanWritercreateBeanWriter(java.io.Writer out)Creates a newBeanWriterfor writing to the given output stream.MarshallercreateMarshaller()Creates a newMarshaller.UnmarshallercreateUnmarshaller(java.util.Locale locale)Creates a newUnmarshaller.StreamFormatgetFormat()SelectorgetLayout()MessageFactorygetMessageFactory()intgetMode()Returns the allowed mode of operation for this stream configuration.java.lang.StringgetName()Returns the name of this stream.voidinit()booleanisIgnoreUnidentifiedRecords()Returns whether to ignore unidentified records.voidsetFormat(StreamFormat format)voidsetIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)Sets whether to ignore unidentified records.voidsetLayout(Selector layout)voidsetMessageFactory(MessageFactory messageFactory)voidsetMode(int mode)Sets the allowed mode of operation for this stream configuration.
-
-
-
Field Detail
-
READ_WRITE_MODE
public static final int READ_WRITE_MODE
Stream definition supports reading and writing- See Also:
- Constant Field Values
-
READ_ONLY_MODE
public static final int READ_ONLY_MODE
Stream definition supports reading only- See Also:
- Constant Field Values
-
WRITE_ONLY_MODE
public static final int WRITE_ONLY_MODE
Stream definition supports writing only- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Stream
public Stream(StreamFormat format)
Constructs a newStream.- Parameters:
format- theStreamFormat
-
-
Method Detail
-
init
public void init()
-
getName
public java.lang.String getName()
Returns the name of this stream.- Returns:
- the stream name
-
createBeanReader
public BeanReader createBeanReader(java.io.Reader in, java.util.Locale locale)
Creates a newBeanReaderfor reading from the given input stream.- Parameters:
in- the input stream to read fromlocale- the locale to use for rendering error messages- Returns:
- the new
BeanReader
-
createUnmarshaller
public Unmarshaller createUnmarshaller(java.util.Locale locale)
Creates a newUnmarshaller.- Parameters:
locale- theLocaleto use for rendering error messages- Returns:
- the new
Unmarshaller
-
createBeanWriter
public BeanWriter createBeanWriter(java.io.Writer out)
Creates a newBeanWriterfor writing to the given output stream.- Parameters:
out- the output stream to write to- Returns:
- the new
BeanWriter
-
createMarshaller
public Marshaller createMarshaller()
Creates a newMarshaller.- Returns:
- the new
Marshaller
-
getMode
public int getMode()
Returns the allowed mode of operation for this stream configuration.- Returns:
READ_WRITE_MODEif reading and writing from a stream is allowed,READ_ONLY_MODEif only reading is allowed,WRITE_ONLY_MODEif only writing is allowed
-
setMode
public void setMode(int mode)
Sets the allowed mode of operation for this stream configuration.- Parameters:
mode-READ_WRITE_MODEif reading and writing from a stream is allowed,READ_ONLY_MODEif only reading is allowed,WRITE_ONLY_MODEif only writing is allowed
-
getLayout
public Selector getLayout()
-
setLayout
public void setLayout(Selector layout)
-
getFormat
public StreamFormat getFormat()
-
setFormat
public void setFormat(StreamFormat format)
-
getMessageFactory
public MessageFactory getMessageFactory()
-
setMessageFactory
public void setMessageFactory(MessageFactory messageFactory)
-
isIgnoreUnidentifiedRecords
public boolean isIgnoreUnidentifiedRecords()
Returns whether to ignore unidentified records. Defaults to false.- Returns:
- true to ignore unidentified records, false otherwise
- Since:
- 2.0.4
-
setIgnoreUnidentifiedRecords
public void setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
Sets whether to ignore unidentified records. Defaults to false.- Parameters:
ignoreUnidentifiedRecords- true to ignore unidentified records, false otherwise- Since:
- 2.0.4
-
-