public class JsonStreamParser extends Object implements Closeable
builder()
. Use the builder to register
JSON pointers and associated callbacks.
Supply the input JSON by calling feed(ByteBuf)
repeatedly.
Close the parser after feeding the last of the data.
Not thread safe.
Modifier and Type | Class and Description |
---|---|
static class |
JsonStreamParser.Builder
Builder instances are reusable provided that ALL configuration of the instance
occurs before any call to
JsonStreamParser.Builder.build() . |
Modifier and Type | Method and Description |
---|---|
static JsonStreamParser.Builder |
builder()
Construct new parser instances using the builder returned by this method.
|
void |
close()
Releases resources managed by the parser.
|
void |
endOfInput()
Should be called after last chunk of data to parse has been fed.
|
void |
feed(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf input)
Consumes all readable bytes from the given buffer.
|
public static JsonStreamParser.Builder builder()
public void feed(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf input) throws DecodingFailureException
Call this method repeatedly as more input becomes available.
DecodingFailureException
- if malformed JSON is detected in this chunk of input
or if a value consumer throws an exception.public void endOfInput()
DecodingFailureException
- if malformed JSON is detected in this chunk of input.public void close()
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2020 Couchbase, Inc.. All rights reserved.