类 DefaultRecordSeparatorPolicy
- java.lang.Object
- org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy
- org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy
- 所有已实现的接口:
RecordSeparatorPolicy
- 直接已知子类:
SuffixRecordSeparatorPolicy
public class DefaultRecordSeparatorPolicy extends SimpleRecordSeparatorPolicy
ARecordSeparatorPolicy
that treats all lines as record endings, as long as they do not have unterminated quotes, and do not end in a continuation marker.- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 DefaultRecordSeparatorPolicy()
Default constructor.DefaultRecordSeparatorPolicy(java.lang.String quoteCharacter)
Convenient constructor with quote character as parameter.DefaultRecordSeparatorPolicy(java.lang.String quoteCharacter, java.lang.String continuation)
Convenient constructor with quote character and continuation marker as parameters.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
isEndOfRecord(java.lang.String line)
Return true if the line does not have unterminated quotes (delimited by "), and does not end with a continuation marker ('\').java.lang.String
preProcess(java.lang.String line)
If we are in an unterminated quote, add a line separator.void
setContinuation(java.lang.String continuation)
Public setter for the continuation.void
setQuoteCharacter(java.lang.String quoteCharacter)
Public setter for the quoteCharacter.从类继承的方法 org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy
postProcess
构造器详细资料
DefaultRecordSeparatorPolicy
public DefaultRecordSeparatorPolicy()
Default constructor.
DefaultRecordSeparatorPolicy
public DefaultRecordSeparatorPolicy(java.lang.String quoteCharacter)
Convenient constructor with quote character as parameter.- 参数:
quoteCharacter
- value used to indicate a quoted string
DefaultRecordSeparatorPolicy
public DefaultRecordSeparatorPolicy(java.lang.String quoteCharacter, java.lang.String continuation)
Convenient constructor with quote character and continuation marker as parameters.- 参数:
quoteCharacter
- value used to indicate a quoted stringcontinuation
- value used to indicate a line continuation
方法详细资料
setQuoteCharacter
public void setQuoteCharacter(java.lang.String quoteCharacter)
Public setter for the quoteCharacter. Defaults to double quote mark.- 参数:
quoteCharacter
- the quoteCharacter to set
setContinuation
public void setContinuation(java.lang.String continuation)
Public setter for the continuation. Defaults to back slash.- 参数:
continuation
- the continuation to set
isEndOfRecord
public boolean isEndOfRecord(java.lang.String line)
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.- 指定者:
isEndOfRecord
在接口中RecordSeparatorPolicy
- 覆盖:
isEndOfRecord
在类中SimpleRecordSeparatorPolicy
- 参数:
line
- a String without a newline character at the end.- 返回:
- true if this line is a complete record.
- 另请参阅:
RecordSeparatorPolicy.isEndOfRecord(java.lang.String)
preProcess
public java.lang.String preProcess(java.lang.String 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.- 指定者:
preProcess
在接口中RecordSeparatorPolicy
- 覆盖:
preProcess
在类中SimpleRecordSeparatorPolicy
- 参数:
line
- the current record.- 返回:
- the line as it should be appended to a record.
- 另请参阅:
SimpleRecordSeparatorPolicy.preProcess(java.lang.String)