java.lang.Object
io.avaje.jsonb.stream.JsonStream
- All Implemented Interfaces:
JsonStreamAdapter
Default implementation of JsonStreamAdapter provided with Jsonb.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUsed to build JsonStream with custom settings. -
Constructor Summary
ConstructorsConstructorDescriptionCreate with the given default configuration.JsonStream(boolean serializeNulls, boolean serializeEmpty, boolean failOnUnknown) Create additionally providing the jsonFactory. -
Method Summary
Modifier and TypeMethodDescriptionReturn a JsonWriter for use for writing to json string.Return a JsonWriter to use for writing json to byte array.static JsonStream.Builderbuilder()Return a new builder to create a JsonStream with custom configuration.properties(String... names) Return PropertyNames given the names of properties.reader(byte[] json) Return the JsonReader given json content as bytes.reader(InputStream inputStream) Return the JsonReader given json string content.Return the JsonReader given json string content.Return the JsonReader given json string content.writer(JsonOutput output) Return the JsonWriter given the output.writer(OutputStream outputStream) Return the JsonWriter given the outputStream.Return the JsonWriter given writer to use.
-
Constructor Details
-
JsonStream
public JsonStream()Create with the given default configuration. -
JsonStream
public JsonStream(boolean serializeNulls, boolean serializeEmpty, boolean failOnUnknown) Create additionally providing the jsonFactory.
-
-
Method Details
-
builder
Return a new builder to create a JsonStream with custom configuration.var jsonStream = JsonStream.builder() .serializeNulls(true) .build(); -
properties
Description copied from interface:JsonStreamAdapterReturn PropertyNames given the names of properties.The PropertyNames can prepare the names for writing such as escaping quotes and encoding to bytes so that the names can be written more efficiently.
- Specified by:
propertiesin interfaceJsonStreamAdapter- See Also:
-
reader
Description copied from interface:JsonStreamAdapterReturn the JsonReader given json string content.- Specified by:
readerin interfaceJsonStreamAdapter
-
reader
Description copied from interface:JsonStreamAdapterReturn the JsonReader given json content as bytes.- Specified by:
readerin interfaceJsonStreamAdapter
-
reader
Description copied from interface:JsonStreamAdapterReturn the JsonReader given json string content.- Specified by:
readerin interfaceJsonStreamAdapter
-
reader
Description copied from interface:JsonStreamAdapterReturn the JsonReader given json string content.- Specified by:
readerin interfaceJsonStreamAdapter
-
writer
Description copied from interface:JsonStreamAdapterReturn the JsonWriter given writer to use.- Specified by:
writerin interfaceJsonStreamAdapter
-
writer
Description copied from interface:JsonStreamAdapterReturn the JsonWriter given the outputStream.- Specified by:
writerin interfaceJsonStreamAdapter
-
writer
Description copied from interface:JsonStreamAdapterReturn the JsonWriter given the output.- Specified by:
writerin interfaceJsonStreamAdapter
-
bufferedWriter
Description copied from interface:JsonStreamAdapterReturn a JsonWriter for use for writing to json string.- Specified by:
bufferedWriterin interfaceJsonStreamAdapter
-
bufferedWriterAsBytes
Description copied from interface:JsonStreamAdapterReturn a JsonWriter to use for writing json to byte array.- Specified by:
bufferedWriterAsBytesin interfaceJsonStreamAdapter
-