JsonUtils
Utilities to convert from and to JSON format.
API
class JsonUtils {
Optional<Class<?>> getPlatformDefaultJsonProviderForJaxb() (1)
Try<T> tryRead(Class<T> mappedType, String stringUtf8, JsonUtils.JacksonCustomizer... customizers) (2)
Try<T> tryRead(Class<T> mappedType, DataSource source, JsonUtils.JacksonCustomizer... customizers) (3)
Try<List<T>> tryReadAsList(Class<T> elementType, DataSource source, JsonUtils.JacksonCustomizer... customizers) (4)
void write(Object pojo, DataSink sink, JsonUtils.JacksonCustomizer... customizers) (5)
String toStringUtf8(Object pojo, JsonUtils.JacksonCustomizer... customizers) (6)
MapperBuilder<M, B> indentedOutput(MapperBuilder<M, B> builder) (7)
MapperBuilder<M, B> onlyIncludeNonNull(MapperBuilder<M, B> builder) (8)
MapperBuilder<M, B> jaxbAnnotationSupport(MapperBuilder<M, B> builder) (9)
MapperBuilder<M, B> readingJavaTimeSupport(MapperBuilder<M, B> builder) (10)
MapperBuilder<M, B> writingJavaTimeSupport(MapperBuilder<M, B> builder) (11)
MapperBuilder<M, B> readingCanSupport(MapperBuilder<M, B> builder) (12)
MapperBuilder<M, B> writingCanSupport(MapperBuilder<M, B> builder) (13)
}
| 1 | getPlatformDefaultJsonProviderForJaxb()
Consumers of the framework may choose to use a different provider. |
| 2 | tryRead(Class, String, JsonUtils_JacksonCustomizer)
Tries to deserialize JSON content from given UTF8 encoded String into an instance of given mappedType . |
| 3 | tryRead(Class, DataSource, JsonUtils_JacksonCustomizer)
Tries to deserialize JSON content from given DataSource into an instance of given mappedType . |
| 4 | tryReadAsList(Class, DataSource, JsonUtils_JacksonCustomizer)
Tries to deserialize JSON content from given DataSource into a List with given elementType . |
| 5 | write(Object, DataSink, JsonUtils_JacksonCustomizer)
Writes given pojo to given DataSink . |
| 6 | toStringUtf8(Object, JsonUtils_JacksonCustomizer)
Converts given pojo to an UTF8 encoded String . |
| 7 | indentedOutput(MapperBuilder)
enable indentation for the underlying generator |
| 8 | onlyIncludeNonNull(MapperBuilder)
only properties with non-null values are to be included |
| 9 | jaxbAnnotationSupport(MapperBuilder)
add support for JAXB annotations |
| 10 | readingJavaTimeSupport(MapperBuilder)
add support for reading java.time (ISO) |
| 11 | writingJavaTimeSupport(MapperBuilder)
add support for writing java.time (ISO) |
| 12 | readingCanSupport(MapperBuilder)
add support for reading Can |
| 13 | writingCanSupport(MapperBuilder)
add support for writing Can |
Members
getPlatformDefaultJsonProviderForJaxb()
Consumers of the framework may choose to use a different provider.
tryRead(Class, String, JsonUtils_JacksonCustomizer)
Tries to deserialize JSON content from given UTF8 encoded String into an instance of given mappedType .
tryRead(Class, DataSource, JsonUtils_JacksonCustomizer)
Tries to deserialize JSON content from given DataSource into an instance of given mappedType .
tryReadAsList(Class, DataSource, JsonUtils_JacksonCustomizer)
Tries to deserialize JSON content from given DataSource into a List with given elementType .
write(Object, DataSink, JsonUtils_JacksonCustomizer)
Writes given pojo to given DataSink .