Class JsonStreamParser.Builder
java.lang.Object
com.couchbase.client.core.json.stream.JsonStreamParser.Builder
- Enclosing class:
- JsonStreamParser
Builder instances are reusable provided that ALL configuration of the instance
occurs before any call to
build()
.
Not thread safe.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Return a new parser using the builder's configuration.build
(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf scratchBuffer, StreamWindow window) Return a new parser that uses the given scratch buffer and stream window.doOnValue
(String jsonPointer, Consumer<MatchedValue> callback) Register a callback to invoke when the target of the JSON pointer is found.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
doOnValue
Register a callback to invoke when the target of the JSON pointer is found.The JSON pointer path component "-" (which normally refers to the non-existent array element after the end) is interpreted as a wildcard that matches every element.
-
build
Return a new parser using the builder's configuration. May be called repeatedly to get fresh parsers with the same configuration. -
build
public JsonStreamParser build(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf scratchBuffer, StreamWindow window) Return a new parser that uses the given scratch buffer and stream window. May be called repeatedly to get fresh parsers with the same configuration, but care must be taken to ensure only one parser is using the scratch buffer at a time.- Parameters:
scratchBuffer
- for readingwindow
- for allocating the stream window's composite buffer.
-