BeanIO 2.0.4

org.beanio
Interface BeanWriter

All Known Implementing Classes:
BeanWriterImpl

public interface BeanWriter

Interface for marshalling bean objects to an output stream.

A BeanWriter is created using a StreamFactory and a mapping file.

Since:
1.0
Author:
Kevin Seim
See Also:
StreamFactory

Method Summary
 void close()
          Closes this output stream.
 void flush()
          Flushes this output stream.
 void write(Object bean)
          Writes a bean object to this output stream.
 void write(String recordName, Object bean)
          Writes a bean object to this output stream.
 

Method Detail

write

void write(Object bean)
           throws BeanWriterException,
                  BeanWriterIOException
Writes a bean object to this output stream.

Parameters:
bean - the bean object to write
Throws:
BeanWriterException - if a record could not be identified for marshalling, or in a few other rare (but fatal) cases
BeanWriterIOException - if the underlying output stream throws an IOException, or if this writer is closed

write

void write(String recordName,
           Object bean)
           throws BeanWriterException
Writes a bean object to this output stream.

Parameters:
recordName - the record or group name bound to the bean object from the mapping file
bean - the bean object to write
Throws:
BeanWriterException - if a record could not be identified for marshalling, or in a few other rare (but fatal) cases
BeanWriterIOException - if the underlying output stream throws an IOException, or if this writer is closed

flush

void flush()
           throws BeanWriterIOException
Flushes this output stream.

Throws:
BeanWriterIOException - if the underlying output stream throws an IOException, or if this writer is closed

close

void close()
           throws BeanWriterIOException
Closes this output stream.

Throws:
BeanWriterIOException - if the underlying output stream throws an IOException, or if this writer is already closed

BeanIO 2.0.4

Copyright © 2010-2013 Kevin Seim