类 JsonRecordSeparatorPolicy
- java.lang.Object
- org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy
- org.springframework.batch.item.file.separator.JsonRecordSeparatorPolicy
- 所有已实现的接口:
RecordSeparatorPolicy
public class JsonRecordSeparatorPolicy extends SimpleRecordSeparatorPolicy
JSON-based record separator. Waits for a valid JSON object before returning a complete line. A valid object has balanced braces ({}), possibly nested, and ends with a closing brace. This separator can be used to split a stream into JSON objects, even if those objects are spread over multiple lines, e.g.{"foo": "bar", "value": { "spam": 2 }} {"foo": "rab", "value": { "spam": 3, "foo": "bar" }}
- 作者:
- Dave Syer
构造器概要
构造器 构造器 说明 JsonRecordSeparatorPolicy()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
isEndOfRecord(java.lang.String line)
True if the line can be parsed to a JSON object.从类继承的方法 org.springframework.batch.item.file.separator.SimpleRecordSeparatorPolicy
postProcess, preProcess
构造器详细资料
JsonRecordSeparatorPolicy
public JsonRecordSeparatorPolicy()
方法详细资料
isEndOfRecord
public boolean isEndOfRecord(java.lang.String line)
True if the line can be parsed to a JSON object.- 指定者:
isEndOfRecord
在接口中RecordSeparatorPolicy
- 覆盖:
isEndOfRecord
在类中SimpleRecordSeparatorPolicy
- 参数:
line
- a String without a newline character at the end.- 返回:
- true if this line is a complete record.
- 另请参阅:
RecordSeparatorPolicy.isEndOfRecord(String)