class DefaultRecordSeparatorPolicy extends SimpleRecordSeparatorPolicy {

	private static final String QUOTE = "\"";

	private static final String CONTINUATION = "\\";

	private String quoteCharacter;

	private String continuation;

	/**
	 * Default constructor.
	 */
	public DefaultRecordSeparatorPolicy() {
		this(QUOTE, CONTINUATION);
	}

	/**
	 * Convenient constructor with quote character as parameter.
	 * @param quoteCharacter value used to indicate a quoted string
	 */
	public DefaultRecordSeparatorPolicy(String quoteCharacter) {
		this(quoteCharacter, CONTINUATION);
	}

	/**
	 * Convenient constructor with quote character and continuation marker as parameters.
	 * @param quoteCharacter value used to indicate a quoted string
	 * @param continuation value used to indicate a line continuation
	 */
	public DefaultRecordSeparatorPolicy(String quoteCharacter, String continuation) {
		super();
		this.continuation = continuation;
		this.quoteCharacter = quoteCharacter;
	}

	/**
	 * Public setter for the quoteCharacter. Defaults to double quote mark.
	 * @param quoteCharacter the quoteCharacter to set
	 */
	public void setQuoteCharacter(String quoteCharacter) {
		this.quoteCharacter = quoteCharacter;
	}

	/**
	 * Public setter for the continuation. Defaults to back slash.
	 * @param continuation the continuation to set
	 */
	public void setContinuation(String continuation) {
		this.continuation = continuation;
	}

	/**
	 * Return true if the line does not have unterminated quotes (delimited by "), and
	 * does not end with a continuation marker ('\'). The test for the continuation marker
	 * ignores whitespace at the end of the line.
	 *
	 * @see org.springframework.batch.item.file.separator.RecordSeparatorPolicy#isEndOfRecord(java.lang.String)
	 */
	@Override
	public boolean isEndOfRecord(String line) {
		return !isQuoteUnterminated(line) && !isContinued(line);
	}

	/**
	 * If we are in an unterminated quote, add a line separator. Otherwise remove the
	 * continuation marker (plus whitespace at the end) if it is there.
	 *
	 * @see org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy#preProcess(java.lang.String)
	 */
	@Override
	public String preProcess(String line) {<FILL_FUNCTION_BODY>}

	/**
	 * Determine if the current line (or buffered concatenation of lines) contains an
	 * unterminated quote, indicating that the record is continuing onto the next line.
	 * @param line the line to check
	 * @return true if the quote is unterminated, false otherwise
	 */
	private boolean isQuoteUnterminated(String line) {
		return StringUtils.countOccurrencesOf(line, quoteCharacter) % 2 != 0;
	}

	/**
	 * Determine if the current line (or buffered concatenation of lines) ends with the
	 * continuation marker, indicating that the record is continuing onto the next line.
	 * @param line the line to check
	 * @return true if the line ends with the continuation marker, false otherwise
	 */
	private boolean isContinued(String line) {
		if (line == null) {
			return false;
		}
		return line.trim().endsWith(continuation);
	}

}

		if (isQuoteUnterminated(line)) {
			return line + "\n";
		}
		if (isContinued(line)) {
			return line.substring(0, line.lastIndexOf(continuation));
		}
		return line;
	
<methods>public non-sealed void <init>() ,public boolean isEndOfRecord(java.lang.String) ,public java.lang.String postProcess(java.lang.String) ,public java.lang.String preProcess(java.lang.String) <variables>