BeanIO 2.0.4

org.beanio.internal.parser
Class Stream

java.lang.Object
  extended by org.beanio.internal.parser.Stream

public class Stream
extends Object

Since:
2.0
Author:
Kevin Seim

Field Summary
static int READ_ONLY_MODE
          Stream definition supports reading only
static int READ_WRITE_MODE
          Stream definition supports reading and writing
static int WRITE_ONLY_MODE
          Stream definition supports writing only
 
Constructor Summary
Stream(StreamFormat format)
          Constructs a new Stream.
 
Method Summary
 BeanReader createBeanReader(Reader in, Locale locale)
          Creates a new BeanReader for reading from the given input stream.
 BeanWriter createBeanWriter(Writer out)
          Creates a new BeanWriter for writing to the given output stream.
 Marshaller createMarshaller()
          Creates a new Marshaller.
 Unmarshaller createUnmarshaller(Locale locale)
          Creates a new Unmarshaller.
 StreamFormat getFormat()
           
 Selector getLayout()
           
 MessageFactory getMessageFactory()
           
 int getMode()
          Returns the allowed mode of operation for this stream configuration.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 new Stream.

Parameters:
format - the StreamFormat
Method Detail

init

public void init()

getName

public String getName()
Returns the name of this stream.

Returns:
the stream name

createBeanReader

public BeanReader createBeanReader(Reader in,
                                   Locale locale)
Creates a new BeanReader for reading from the given input stream.

Parameters:
in - the input stream to read from
locale - the locale to use for rendering error messages
Returns:
the new BeanReader

createUnmarshaller

public Unmarshaller createUnmarshaller(Locale locale)
Creates a new Unmarshaller.

Parameters:
locale - the Locale to use for rendering error messages
Returns:
the new Unmarshaller

createBeanWriter

public BeanWriter createBeanWriter(Writer out)
Creates a new BeanWriter 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 new Marshaller.

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

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim