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 int
READ_ONLY_MODE
Stream definition supports reading onlystatic int
READ_WRITE_MODE
Stream definition supports reading and writingstatic int
WRITE_ONLY_MODE
Stream 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 BeanReader
createBeanReader(java.io.Reader in, java.util.Locale locale)
Creates a newBeanReader
for reading from the given input stream.BeanWriter
createBeanWriter(java.io.Writer out)
Creates a newBeanWriter
for writing to the given output stream.Marshaller
createMarshaller()
Creates a newMarshaller
.Unmarshaller
createUnmarshaller(java.util.Locale locale)
Creates a newUnmarshaller
.StreamFormat
getFormat()
Selector
getLayout()
MessageFactory
getMessageFactory()
int
getMode()
Returns the allowed mode of operation for this stream configuration.java.lang.String
getName()
Returns the name of this stream.void
init()
boolean
isIgnoreUnidentifiedRecords()
Returns whether to ignore unidentified records.void
setFormat(StreamFormat format)
void
setIgnoreUnidentifiedRecords(boolean ignoreUnidentifiedRecords)
Sets whether to ignore unidentified records.void
setLayout(Selector layout)
void
setMessageFactory(MessageFactory messageFactory)
void
setMode(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 newBeanReader
for 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
- theLocale
to use for rendering error messages- Returns:
- the new
Unmarshaller
-
createBeanWriter
public BeanWriter createBeanWriter(java.io.Writer out)
Creates a newBeanWriter
for 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_MODE
if reading and writing from a stream is allowed,READ_ONLY_MODE
if only reading is allowed,WRITE_ONLY_MODE
if only writing is allowed
-
setMode
public void setMode(int mode)
Sets the allowed mode of operation for this stream configuration.- Parameters:
mode
-READ_WRITE_MODE
if reading and writing from a stream is allowed,READ_ONLY_MODE
if only reading is allowed,WRITE_ONLY_MODE
if 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
-
-