Package org.symphonyoss.s2.canon.runtime
Class JsonArrayParser
- java.lang.Object
-
- org.symphonyoss.s2.canon.runtime.JsonArrayParser
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public abstract class JsonArrayParser extends Object implements Closeable
A parser which takes byte buffers and accumulates a JSON document. If the document is a JSON array then each element of the array is passed to the handle method, one at time. Otherwise the entire document is passed to the handle method. This is intended to be used as a pre-processor to a JSON parser (e.g. Jackson) so that streaming processing of multiple instance payloads can be implemented.- Author:
- Bruce Skingle
-
-
Constructor Summary
Constructors Constructor Description JsonArrayParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract voidhandle(String input)voidprocess(byte[] inputBuffer_, int nbytes)Process the given bytes.
-
-
-
Method Detail
-
process
public void process(byte[] inputBuffer_, int nbytes)Process the given bytes.- Parameters:
inputBuffer_- Byte buffernbytes- Number of valid bytes in the buffer
-
handle
protected abstract void handle(String input)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-