Package org.beanio
Interface BeanWriter
-
- All Superinterfaces:
java.lang.AutoCloseable,Debuggable
- All Known Implementing Classes:
BeanWriterImpl
public interface BeanWriter extends Debuggable, java.lang.AutoCloseable
Interface for marshalling bean objects to an output stream.A
BeanWriteris created using aStreamFactoryand a mapping file.- Since:
- 1.0
- See Also:
StreamFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes this output stream.voidflush()Flushes this output stream.voidwrite(java.lang.Object bean)Writes a bean object to this output stream.voidwrite(java.lang.String recordName, java.lang.Object bean)Writes a bean object to this output stream.-
Methods inherited from interface org.beanio.internal.util.Debuggable
debug, debug
-
-
-
-
Method Detail
-
write
void write(java.lang.Object bean) throws BeanWriterException, BeanWriterIOExceptionWrites 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) casesBeanWriterIOException- if the underlying output stream throws anIOException, or if this writer is closedInvalidBeanException- if BeanIO is configured to validate fields during marshalling, and a field does not meet the configured validation rules
-
write
void write(java.lang.String recordName, java.lang.Object bean) throws BeanWriterExceptionWrites a bean object to this output stream.- Parameters:
recordName- the record or group name bound to the bean object from the mapping filebean- the bean object to write- Throws:
BeanWriterException- if a record could not be identified for marshalling, or in a few other rare (but fatal) casesBeanWriterIOException- if the underlying output stream throws anIOException, or if this writer is closedInvalidBeanException- if BeanIO is configured to validate fields during marshalling, and a field does not meet the configured validation rules
-
flush
void flush() throws BeanWriterIOExceptionFlushes this output stream.- Throws:
BeanWriterIOException- if the underlying output stream throws anIOException, or if this writer is closed
-
close
void close() throws BeanWriterIOExceptionCloses this output stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
BeanWriterIOException- if the underlying output stream throws anIOException, or if this writer is already closed
-
-