Search in sources :

Example 1 with Jackson2ServerHttpMessageReader

use of org.springframework.http.codec.Jackson2ServerHttpMessageReader in project spring-framework by spring-projects.

the class WebFluxConfigurationSupport method addDefaultHttpMessageReaders.

/**
	 * Adds default converters that sub-classes can call from
	 * {@link #configureMessageReaders(List)} for {@code byte[]},
	 * {@code ByteBuffer}, {@code String}, {@code Resource}, JAXB2, and Jackson
	 * (if present on the classpath).
	 */
protected final void addDefaultHttpMessageReaders(List<HttpMessageReader<?>> readers) {
    readers.add(new DecoderHttpMessageReader<>(new ByteArrayDecoder()));
    readers.add(new DecoderHttpMessageReader<>(new ByteBufferDecoder()));
    readers.add(new DecoderHttpMessageReader<>(new DataBufferDecoder()));
    readers.add(new DecoderHttpMessageReader<>(new StringDecoder()));
    readers.add(new DecoderHttpMessageReader<>(new ResourceDecoder()));
    if (jaxb2Present) {
        readers.add(new DecoderHttpMessageReader<>(new Jaxb2XmlDecoder()));
    }
    if (jackson2Present) {
        readers.add(new Jackson2ServerHttpMessageReader(new DecoderHttpMessageReader<>(new Jackson2JsonDecoder())));
    }
}
Also used : DecoderHttpMessageReader(org.springframework.http.codec.DecoderHttpMessageReader) Jackson2JsonDecoder(org.springframework.http.codec.json.Jackson2JsonDecoder) DataBufferDecoder(org.springframework.core.codec.DataBufferDecoder) Jaxb2XmlDecoder(org.springframework.http.codec.xml.Jaxb2XmlDecoder) StringDecoder(org.springframework.core.codec.StringDecoder) ResourceDecoder(org.springframework.core.codec.ResourceDecoder) ByteBufferDecoder(org.springframework.core.codec.ByteBufferDecoder) ByteArrayDecoder(org.springframework.core.codec.ByteArrayDecoder) Jackson2ServerHttpMessageReader(org.springframework.http.codec.Jackson2ServerHttpMessageReader)

Aggregations

ByteArrayDecoder (org.springframework.core.codec.ByteArrayDecoder)1 ByteBufferDecoder (org.springframework.core.codec.ByteBufferDecoder)1 DataBufferDecoder (org.springframework.core.codec.DataBufferDecoder)1 ResourceDecoder (org.springframework.core.codec.ResourceDecoder)1 StringDecoder (org.springframework.core.codec.StringDecoder)1 DecoderHttpMessageReader (org.springframework.http.codec.DecoderHttpMessageReader)1 Jackson2ServerHttpMessageReader (org.springframework.http.codec.Jackson2ServerHttpMessageReader)1 Jackson2JsonDecoder (org.springframework.http.codec.json.Jackson2JsonDecoder)1 Jaxb2XmlDecoder (org.springframework.http.codec.xml.Jaxb2XmlDecoder)1