class FlatFileItemWriter<T> extends AbstractFileItemWriter<T> {

	protected LineAggregator<T> lineAggregator;

	public FlatFileItemWriter() {
		this.setExecutionContextName(ClassUtils.getShortName(FlatFileItemWriter.class));
	}

	/**
	 * Assert that mandatory properties (lineAggregator) are set.
	 *
	 * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
	 */
	@Override
	public void afterPropertiesSet() throws Exception {<FILL_FUNCTION_BODY>}

	/**
	 * Public setter for the {@link LineAggregator}. This will be used to translate the
	 * item into a line for output.
	 * @param lineAggregator the {@link LineAggregator} to set
	 */
	public void setLineAggregator(LineAggregator<T> lineAggregator) {
		this.lineAggregator = lineAggregator;
	}

	@Override
	public String doWrite(Chunk<? extends T> items) {
		StringBuilder lines = new StringBuilder();
		for (T item : items) {
			lines.append(this.lineAggregator.aggregate(item)).append(this.lineSeparator);
		}
		return lines.toString();
	}

}

		Assert.state(lineAggregator != null, "A LineAggregator must be provided.");
		if (append) {
			shouldDeleteIfExists = false;
		}
	
<methods>public non-sealed void <init>() ,public void close() ,public void open(org.springframework.batch.item.ExecutionContext) throws org.springframework.batch.item.ItemStreamException,public void setAppendAllowed(boolean) ,public void setEncoding(java.lang.String) ,public void setFooterCallback(org.springframework.batch.item.file.FlatFileFooterCallback) ,public void setForceSync(boolean) ,public void setHeaderCallback(org.springframework.batch.item.file.FlatFileHeaderCallback) ,public void setLineSeparator(java.lang.String) ,public void setResource(org.springframework.core.io.WritableResource) ,public void setSaveState(boolean) ,public void setShouldDeleteIfEmpty(boolean) ,public void setShouldDeleteIfExists(boolean) ,public void setTransactional(boolean) ,public void update(org.springframework.batch.item.ExecutionContext) ,public void write(Chunk<? extends T>) throws java.lang.Exception<variables>public static final java.lang.String DEFAULT_CHARSET,public static final java.lang.String DEFAULT_LINE_SEPARATOR,public static final boolean DEFAULT_TRANSACTIONAL,private static final java.lang.String RESTART_DATA_NAME,private static final java.lang.String WRITTEN_STATISTICS_NAME,protected boolean append,private java.lang.String encoding,private org.springframework.batch.item.file.FlatFileFooterCallback footerCallback,private boolean forceSync,private org.springframework.batch.item.file.FlatFileHeaderCallback headerCallback,protected java.lang.String lineSeparator,protected static final org.apache.commons.logging.Log logger,private org.springframework.core.io.WritableResource resource,private boolean saveState,private boolean shouldDeleteIfEmpty,protected boolean shouldDeleteIfExists,protected OutputState state,private boolean transactional