类 SuffixRecordSeparatorPolicy
- java.lang.Object
- org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy
- org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy
- org.springframework.batch.item.file.separator.SuffixRecordSeparatorPolicy
- 所有已实现的接口:
RecordSeparatorPolicy
public class SuffixRecordSeparatorPolicy extends DefaultRecordSeparatorPolicy
ARecordSeparatorPolicy
that looks for an exact match for a String at the end of a line (e.g. a semicolon).- 作者:
- Dave Syer
字段概要
字段 修饰符和类型 字段 说明 static java.lang.String
DEFAULT_SUFFIX
Default value for record terminator suffix.
构造器概要
构造器 构造器 说明 SuffixRecordSeparatorPolicy()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
isEndOfRecord(java.lang.String line)
Return true if the line ends with the specified substring.java.lang.String
postProcess(java.lang.String record)
Remove the suffix from the end of the record.void
setIgnoreWhitespace(boolean ignoreWhitespace)
Flag to indicate that the decision to terminate a record should ignore whitespace at the end of the line.void
setSuffix(java.lang.String suffix)
Lines ending in this terminator String signal the end of a record.从类继承的方法 org.springframework.batch.item.file.separator.DefaultRecordSeparatorPolicy
preProcess, setContinuation, setQuoteCharacter
字段详细资料
DEFAULT_SUFFIX
public static final java.lang.String DEFAULT_SUFFIX
Default value for record terminator suffix.- 另请参阅:
- 常量字段值
构造器详细资料
SuffixRecordSeparatorPolicy
public SuffixRecordSeparatorPolicy()
方法详细资料
setSuffix
public void setSuffix(java.lang.String suffix)
Lines ending in this terminator String signal the end of a record.- 参数:
suffix
- suffix to indicate the end of a record
setIgnoreWhitespace
public void setIgnoreWhitespace(boolean ignoreWhitespace)
Flag to indicate that the decision to terminate a record should ignore whitespace at the end of the line.- 参数:
ignoreWhitespace
- indicator
isEndOfRecord
public boolean isEndOfRecord(java.lang.String line)
Return true if the line ends with the specified substring. By default whitespace is trimmed before the comparison. Also returns true if the line is null, but not if it is empty.- 指定者:
isEndOfRecord
在接口中RecordSeparatorPolicy
- 覆盖:
isEndOfRecord
在类中DefaultRecordSeparatorPolicy
- 参数:
line
- a String without a newline character at the end.- 返回:
- true if this line is a complete record.
- 另请参阅:
RecordSeparatorPolicy.isEndOfRecord(java.lang.String)
postProcess
public java.lang.String postProcess(java.lang.String record)
Remove the suffix from the end of the record.- 指定者:
postProcess
在接口中RecordSeparatorPolicy
- 覆盖:
postProcess
在类中SimpleRecordSeparatorPolicy
- 参数:
record
- the complete record.- 返回:
- a modified version of the record if desired.
- 另请参阅:
SimpleRecordSeparatorPolicy.postProcess(java.lang.String)