Class JacksonXmlDecoder

java.lang.Object
org.springframework.http.codec.JacksonCodecSupport<tools.jackson.dataformat.xml.XmlMapper>
org.springframework.http.codec.AbstractJacksonDecoder<tools.jackson.dataformat.xml.XmlMapper>
org.springframework.http.codec.xml.JacksonXmlDecoder
All Implemented Interfaces:
org.springframework.core.codec.Decoder<Object>, HttpMessageDecoder<Object>

public class JacksonXmlDecoder extends AbstractJacksonDecoder<tools.jackson.dataformat.xml.XmlMapper>
Decode bytes into XML and convert to Objects with Jackson 3.x.

Stream decoding is currently not supported.

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

    • JacksonXmlDecoder

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

      public JacksonXmlDecoder(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:
    • JacksonXmlDecoder

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

      public JacksonXmlDecoder(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:
    • JacksonXmlDecoder

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

    • decode

      public Flux<Object> decode(Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String,Object> hints)
      Specified by:
      decode in interface org.springframework.core.codec.Decoder<Object>
      Overrides:
      decode in class AbstractJacksonDecoder<tools.jackson.dataformat.xml.XmlMapper>
    • defensiveXmlFactory

      public static tools.jackson.dataformat.xml.XmlFactory defensiveXmlFactory()
      Return an XmlFactory created from StaxUtils.createDefensiveInputFactory() with Spring's defensive setup, i.e. no support for the resolution of DTDs and external entities.