Class ReactiveJaxbEncoder

  • All Implemented Interfaces:
    org.springframework.core.codec.Encoder<Object>

    @Validated
    public class ReactiveJaxbEncoder
    extends org.springframework.core.codec.AbstractSingleValueEncoder<Object>
    Encode from single value to a byte stream containing XML elements.

    @XmlElements and @XmlElement can be used to specify how collections should be marshalled.

    The encoding parts are taken from Jaxb2XmlEncoder.

    Author:
    Sebastien Deleuze, Arjen Poutsma, Christian Bremer
    • Field Summary

      • Fields inherited from class org.springframework.core.codec.AbstractEncoder

        logger
    • Constructor Summary

      Constructors 
      Constructor Description
      ReactiveJaxbEncoder​(org.bremersee.xml.JaxbContextBuilder jaxbContextBuilder)
      Instantiates a new reactive jaxb encoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canEncode​(org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType)  
      protected reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> encode​(Object value, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType valueType, org.springframework.util.MimeType mimeType, Map<String,​Object> hints)  
      org.springframework.core.io.buffer.DataBuffer encodeValue​(Object value, org.springframework.core.io.buffer.DataBufferFactory bufferFactory, org.springframework.core.ResolvableType valueType, org.springframework.util.MimeType mimeType, Map<String,​Object> hints)  
      • Methods inherited from class org.springframework.core.codec.AbstractSingleValueEncoder

        encode
      • Methods inherited from class org.springframework.core.codec.AbstractEncoder

        getEncodableMimeTypes, getLogger, setLogger
      • Methods inherited from interface org.springframework.core.codec.Encoder

        getEncodableMimeTypes
    • Constructor Detail

      • ReactiveJaxbEncoder

        public ReactiveJaxbEncoder​(org.bremersee.xml.JaxbContextBuilder jaxbContextBuilder)
        Instantiates a new reactive jaxb encoder.
        Parameters:
        jaxbContextBuilder - the jaxb context builder
    • Method Detail

      • canEncode

        public boolean canEncode​(@NonNull
                                 org.springframework.core.ResolvableType elementType,
                                 @Nullable
                                 org.springframework.util.MimeType mimeType)
        Specified by:
        canEncode in interface org.springframework.core.codec.Encoder<Object>
        Overrides:
        canEncode in class org.springframework.core.codec.AbstractEncoder<Object>
      • encode

        @NonNull
        protected reactor.core.publisher.Flux<org.springframework.core.io.buffer.DataBuffer> encode​(@NonNull
                                                                                                    Object value,
                                                                                                    @NonNull
                                                                                                    org.springframework.core.io.buffer.DataBufferFactory bufferFactory,
                                                                                                    @NonNull
                                                                                                    org.springframework.core.ResolvableType valueType,
                                                                                                    @Nullable
                                                                                                    org.springframework.util.MimeType mimeType,
                                                                                                    @Nullable
                                                                                                    Map<String,​Object> hints)
        Specified by:
        encode in class org.springframework.core.codec.AbstractSingleValueEncoder<Object>
      • encodeValue

        @NonNull
        public org.springframework.core.io.buffer.DataBuffer encodeValue​(@NonNull
                                                                         Object value,
                                                                         @NonNull
                                                                         org.springframework.core.io.buffer.DataBufferFactory bufferFactory,
                                                                         @NonNull
                                                                         org.springframework.core.ResolvableType valueType,
                                                                         @Nullable
                                                                         org.springframework.util.MimeType mimeType,
                                                                         @Nullable
                                                                         Map<String,​Object> hints)