org.springframework.http.codec.xml

Class Jaxb2XmlDecoder

  • All Implemented Interfaces:
    Decoder<java.lang.Object>


    public class Jaxb2XmlDecoder
    extends AbstractDecoder<java.lang.Object>
    Decode from a bytes stream containing XML elements to a stream of Objects (POJOs).
    Since:
    5.0
    Author:
    Sebastien Deleuze, Arjen Poutsma
    See Also:
    Jaxb2XmlEncoder
    • Constructor Detail

      • Jaxb2XmlDecoder

        public Jaxb2XmlDecoder()
    • Method Detail

      • canDecode

        public boolean canDecode(ResolvableType elementType,
                                 @Nullable
                                 MimeType mimeType)
        Description copied from interface: Decoder
        Whether the decoder supports the given target element type and the MIME type of the source stream.
        Specified by:
        canDecode in interface Decoder<java.lang.Object>
        Overrides:
        canDecode in class AbstractDecoder<java.lang.Object>
        Parameters:
        elementType - the target element type for the output stream
        mimeType - the mime type associated with the stream to decode (can be null if not specified)
        Returns:
        true if supported, false otherwise
      • decode

        public reactor.core.publisher.Flux<java.lang.Object> decode(org.reactivestreams.Publisher<DataBuffer> inputStream,
                                                                    ResolvableType elementType,
                                                                    @Nullable
                                                                    MimeType mimeType,
                                                                    @Nullable
                                                                    java.util.Map<java.lang.String,java.lang.Object> hints)
        Description copied from interface: Decoder
        Decode a DataBuffer input stream into a Flux of T.
        Parameters:
        inputStream - the DataBuffer input stream to decode
        elementType - the expected type of elements in the output stream; this type must have been previously passed to the Decoder.canDecode(org.springframework.core.ResolvableType, org.springframework.util.MimeType) method and it must have returned true.
        mimeType - the MIME type associated with the input stream (optional)
        hints - additional information about how to do encode
        Returns:
        the output stream with decoded elements