public abstract class JsonSplitter extends Object implements Iterable<Payload>, Closeable
findNextNodeStart()).
While iterating the caller must properly consume the Payload instances before the next iteration. Failure
to do so will result in the iterator returning the same Payload again.
The implementations of this class should be careful about handling the JsonParser, especially if it uses a
different JsonGenerator, since the method JsonGenerator.copyCurrentStructure(JsonParser) is called by
the payload implementation that this class uses.
This class must be closed in order to free underlying resources.
| Modifier | Constructor and Description |
|---|---|
protected |
JsonSplitter(InputStream inputStream) |
protected |
JsonSplitter(JsonParser parser) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected JsonGenerator |
createGenerator(OutputStream out) |
protected abstract JsonToken |
findNextNodeStart() |
protected JsonParser |
getParser() |
protected void |
initialize() |
Iterator<Payload> |
iterator() |
protected JsonToken |
waitForToken(JsonToken expectedToken) |
protected JsonToken |
waitForTokens(Set<JsonToken> tokenSet) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected JsonSplitter(InputStream inputStream) throws IOException
IOExceptionprotected JsonSplitter(JsonParser parser)
protected final JsonParser getParser()
protected final JsonToken waitForToken(JsonToken expectedToken) throws IOException
IOExceptionprotected final JsonToken waitForTokens(Set<JsonToken> tokenSet) throws IOException
IOExceptionprotected JsonGenerator createGenerator(OutputStream out) throws IOException
IOExceptionprotected void initialize()
throws IOException
IOExceptionprotected abstract JsonToken findNextNodeStart() throws IOException
IOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseable