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 class
Used 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.Builder
builder()
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:JsonStreamAdapter
Return 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:
properties
in interfaceJsonStreamAdapter
- See Also:
-
reader
Description copied from interface:JsonStreamAdapter
Return the JsonReader given json string content.- Specified by:
reader
in interfaceJsonStreamAdapter
-
reader
Description copied from interface:JsonStreamAdapter
Return the JsonReader given json content as bytes.- Specified by:
reader
in interfaceJsonStreamAdapter
-
reader
Description copied from interface:JsonStreamAdapter
Return the JsonReader given json string content.- Specified by:
reader
in interfaceJsonStreamAdapter
-
reader
Description copied from interface:JsonStreamAdapter
Return the JsonReader given json string content.- Specified by:
reader
in interfaceJsonStreamAdapter
-
writer
Description copied from interface:JsonStreamAdapter
Return the JsonWriter given writer to use.- Specified by:
writer
in interfaceJsonStreamAdapter
-
writer
Description copied from interface:JsonStreamAdapter
Return the JsonWriter given the outputStream.- Specified by:
writer
in interfaceJsonStreamAdapter
-
writer
Description copied from interface:JsonStreamAdapter
Return the JsonWriter given the output.- Specified by:
writer
in interfaceJsonStreamAdapter
-
bufferedWriter
Description copied from interface:JsonStreamAdapter
Return a JsonWriter for use for writing to json string.- Specified by:
bufferedWriter
in interfaceJsonStreamAdapter
-
bufferedWriterAsBytes
Description copied from interface:JsonStreamAdapter
Return a JsonWriter to use for writing json to byte array.- Specified by:
bufferedWriterAsBytes
in interfaceJsonStreamAdapter
-