Class JsonRecordSeparatorPolicy

  • All Implemented Interfaces:
    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" }}
     
    Author:
    Dave Syer