Class JacksonXmlEncoder

java.lang.Object
org.springframework.http.codec.JacksonCodecSupport<tools.jackson.dataformat.xml.XmlMapper>
org.springframework.http.codec.AbstractJacksonEncoder<tools.jackson.dataformat.xml.XmlMapper>
org.springframework.http.codec.xml.JacksonXmlEncoder
All Implemented Interfaces:
org.springframework.core.codec.Encoder<Object>, HttpMessageEncoder<Object>

public class JacksonXmlEncoder extends AbstractJacksonEncoder<tools.jackson.dataformat.xml.XmlMapper>
Encode from an Object to bytes of XML objects using Jackson 3.x.

Stream encoding is currently not supported.

Since:
7.0.3
Author:
Sebastien Deleuze
See Also:
  • Constructor Details

    • JacksonXmlEncoder

      public JacksonXmlEncoder()
      Construct a new instance with a XmlMapper customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader).
    • JacksonXmlEncoder

      public JacksonXmlEncoder(tools.jackson.dataformat.xml.XmlMapper.Builder builder)
      Construct a new instance with the provided XmlMapper.Builder customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader).
      See Also:
      • XmlMapper.builder()
    • JacksonXmlEncoder

      public JacksonXmlEncoder(tools.jackson.dataformat.xml.XmlMapper mapper)
      Construct a new instance with the provided XmlMapper.
      See Also:
      • XmlMapper.builder()
    • JacksonXmlEncoder

      public JacksonXmlEncoder(tools.jackson.dataformat.xml.XmlMapper.Builder builder, org.springframework.util.MimeType... mimeTypes)
      Construct a new instance with the provided XmlMapper.Builder customized with the JacksonModules found by MapperBuilder.findModules(ClassLoader), and MimeTypes.
      See Also:
      • XmlMapper.builder()
    • JacksonXmlEncoder

      public JacksonXmlEncoder(tools.jackson.dataformat.xml.XmlMapper mapper, org.springframework.util.MimeType... mimeTypes)
      Construct a new instance with the provided XmlMapper and MimeTypes.
      See Also:
      • XmlMapper.builder()
  • Method Details

    • encode

      public Flux<org.springframework.core.io.buffer.DataBuffer> encode(Publisher<?> inputStream, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
      Specified by:
      encode in interface org.springframework.core.codec.Encoder<Object>
      Overrides:
      encode in class AbstractJacksonEncoder<tools.jackson.dataformat.xml.XmlMapper>