Interface Jackson3ObjectWriter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Defines the contract for Object Mapping writers. Implementations of this interface can serialize a given Object to a
byte[]
containing JSON.
Writer functions can customize how the actual JSON is being written by e.g. obtaining a customized
ObjectWriter
applying serialization features, date formats, or views.
- Since:
- 4.0
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic Jackson3ObjectWriter
create()
Create a defaultJackson3ObjectWriter
delegating toObjectMapper.writeValueAsBytes(Object)
.byte[]
Write the object graph with the given rootsource
as byte array.
-
Method Details
-
write
Write the object graph with the given rootsource
as byte array.- Parameters:
mapper
- the object mapper to use.source
- the root of the object graph to marshal.- Returns:
- a byte array containing the serialized object graph.
-
create
Create a defaultJackson3ObjectWriter
delegating toObjectMapper.writeValueAsBytes(Object)
.- Returns:
- the default
Jackson3ObjectWriter
.
-