package org.commacq;

import java.io.PrintWriter;
import java.io.Writer;

/**
 * Contains a large buffer. Reuse these objects.
 */
public class CsvLineCallbackWriter extends CsvLineCallbackAbstractSimple {
	
	private final PrintWriter printWriter;
	
	public CsvLineCallbackWriter(Writer writer) {
		printWriter = new PrintWriter(writer);
	}
	
	@Override
	public void processUpdate(String columnNamesCsv, CsvLine csvLine) throws CsvUpdateBlockException {
		printWriter.println(csvLine.getCsvLine());
	}
	
	@Override
	public void processRemove(String id) throws CsvUpdateBlockException {
		printWriter.println(id);
	}
}

@@ -163,14 +163,17 @@
 ter 
-extend
+implement
 s Cs
@@ -189,22 +189,8 @@
 back
-AbstractSimple
  %7B%0A%09
@@ -560,32 +560,32 @@
 lockException %7B%0A
-
 %09%09printWriter.pr
@@ -598,10 +598,649 @@
 id);%0A%09%7D%0A
+%09%0A%09/**%0A%09 * Add csv header%0A%09 */%0A%09@Override%0A%09public void startUpdateBlock(String columnNamesCsv) throws CsvUpdateBlockException %7B%0A%09%09printWriter.println(columnNamesCsv);%0A%09%7D%0A%09%0A%09@Override%0A%09public final void finishUpdateBlock() throws CsvUpdateBlockException %7B%0A%09%09//No behaviour defined.%0A%09%7D%0A%09%0A%09@Override%0A%09public final void startBulkUpdate(String columnNamesCsv) throws CsvUpdateBlockException %7B%0A%09%09//No behaviour defined.%0A%09%7D%0A%09%0A%09@Override%0A%09public final void startBulkUpdateForGroup(String group, String idWithinGroup) throws CsvUpdateBlockException %7B%0A%09%09//No behaviour defined.%0A%09%7D%0A%09%0A%09@Override%0A%09public void cancel() %7B%0A%09%09//No behaviour defined.%09%09%0A%09%7D%0A
 %7D%0A

Correct Http Csv output so that it contains the csv column headings.