Class HeaderCopyCallback
- java.lang.Object
- org.springframework.batch.sample.support.HeaderCopyCallback
- All Implemented Interfaces:
FlatFileHeaderCallback,LineCallbackHandler
public class HeaderCopyCallback extends java.lang.Object implements LineCallbackHandler, FlatFileHeaderCallback
Designed to be registered with bothFlatFileItemReaderandFlatFileItemWriterand copy header line from input file to output file.
Constructor Summary
Constructors Constructor Description HeaderCopyCallback()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleLine(java.lang.String line)voidwriteHeader(java.io.Writer writer)Write contents to a file using the suppliedWriter.
Method Detail
handleLine
public void handleLine(java.lang.String line)
- Specified by:
handleLinein interfaceLineCallbackHandler
writeHeader
public void writeHeader(java.io.Writer writer) throws java.io.IOExceptionDescription copied from interface:FlatFileHeaderCallbackWrite contents to a file using the suppliedWriter. It is not required to flush the writer inside this method.- Specified by:
writeHeaderin interfaceFlatFileHeaderCallback- Parameters:
writer- theWriterto be used to write the header.- Throws:
java.io.IOException- if error occurs during writing.