Improve Jackson codecs documentation
This commit is contained in:
parent
73a81f98d4
commit
6a7b197af7
|
@ -46,12 +46,13 @@ import org.springframework.util.Assert;
|
|||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
* Abstract base class for Jackson JSON 2.9 decoding.
|
||||
* Abstract base class for Jackson 2.9 decoding, leveraging non-blocking parsing.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Arjen Poutsma
|
||||
* @since 5.0
|
||||
* @see <a href="https://github.com/FasterXML/jackson-core/issues/57" target="_blank">Add support for non-blocking ("async") JSON parsing</a>
|
||||
*/
|
||||
public abstract class AbstractJackson2Decoder extends Jackson2CodecSupport implements HttpMessageDecoder<Object> {
|
||||
|
||||
|
|
|
@ -48,7 +48,9 @@ import org.springframework.util.Assert;
|
|||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
* Base class providing support methods for Jackson 2.9 encoding.
|
||||
* Base class providing support methods for Jackson 2.9 encoding. For non-streaming use
|
||||
* cases, {@link Flux} elements are collected into a {@link List} before serialization for
|
||||
* performance reason.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Arjen Poutsma
|
||||
|
|
|
@ -24,7 +24,8 @@ import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
|||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
* Decode a byte stream into JSON and convert to Object's with Jackson 2.9.
|
||||
* Decode a byte stream into JSON and convert to Object's with Jackson 2.9,
|
||||
* leveraging non-blocking parsing.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
|
|||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.core.ResolvableType;
|
||||
import org.springframework.http.MediaType;
|
||||
|
@ -33,8 +34,9 @@ import org.springframework.lang.Nullable;
|
|||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
* Encode from an {@code Object} stream to a byte stream of JSON objects,
|
||||
* using Jackson 2.9.
|
||||
* Encode from an {@code Object} stream to a byte stream of JSON objects using Jackson 2.9.
|
||||
* For non-streaming use cases, {@link Flux} elements are collected into a {@link List}
|
||||
* before serialization for performance reason.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Arjen Poutsma
|
||||
|
|
|
@ -28,7 +28,8 @@ import org.springframework.util.Assert;
|
|||
import org.springframework.util.MimeType;
|
||||
|
||||
/**
|
||||
* Decode a byte stream into Smile and convert to Object's with Jackson 2.9.
|
||||
* Decode a byte stream into Smile and convert to Object's with Jackson 2.9,
|
||||
* leveraging non-blocking parsing.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.List;
|
|||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.dataformat.smile.SmileFactory;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
@ -29,6 +30,8 @@ import org.springframework.util.MimeType;
|
|||
|
||||
/**
|
||||
* Encode from an {@code Object} stream to a byte stream of Smile objects using Jackson 2.9.
|
||||
* For non-streaming use cases, {@link Flux} elements are collected into a {@link List}
|
||||
* before serialization for performance reason.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @since 5.0
|
||||
|
|
|
@ -160,7 +160,7 @@ Note that a decoder instance needs to consider <<databuffer-reference-counting,
|
|||
|
||||
Spring comes with a wide array of default codecs, capable of converting from/to `String`,
|
||||
`ByteBuffer`, byte arrays, and also codecs that support marshalling libraries such as JAXB and
|
||||
Jackson.
|
||||
Jackson (with https://github.com/FasterXML/jackson-core/issues/57[Jackson 2.9+ support for non-blocking parsing]).
|
||||
Withing the context of Spring WebFlux, codecs are used to convert the request body into a
|
||||
`@RequestMapping` parameter, or to convert the return type into the response body that is sent back
|
||||
to the client.
|
||||
|
|
Loading…
Reference in New Issue