Package org.bremersee.xml.http.codec
Class ReactiveJaxbDecoder
java.lang.Object
org.springframework.core.codec.AbstractDecoder<Object>
org.bremersee.xml.http.codec.ReactiveJaxbDecoder
- All Implemented Interfaces:
org.springframework.core.codec.Decoder<Object>
Decode from a bytes stream containing XML elements to a stream of
Object
s (POJOs).
The decoding parts are taken from Jaxb2XmlDecoder
.
- Author:
- Sebastien Deleuze, Arjen Poutsma, Christian Bremer
-
Field Summary
Fields inherited from class org.springframework.core.codec.AbstractDecoder
logger
-
Constructor Summary
ConstructorsConstructorDescriptionReactiveJaxbDecoder
(JaxbContextBuilder jaxbContextBuilder) Instantiates a new reactive jaxb decoder.ReactiveJaxbDecoder
(JaxbContextBuilder jaxbContextBuilder, Set<Class<?>> ignoreReadingClasses) Instantiates a new Reactive jaxb decoder. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDecode
(org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType) reactor.core.publisher.Flux<Object>
decode
(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) decode
(org.springframework.core.io.buffer.DataBuffer dataBuffer, org.springframework.core.ResolvableType targetType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) reactor.core.publisher.Mono<Object>
decodeToMono
(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) int
Return theconfigured
byte count limit.void
setMaxInMemorySize
(int byteCount) Set the max number of bytes that can be buffered by this decoder.Methods inherited from class org.springframework.core.codec.AbstractDecoder
getDecodableMimeTypes, getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.core.codec.Decoder
getDecodableMimeTypes
-
Constructor Details
-
ReactiveJaxbDecoder
Instantiates a new reactive jaxb decoder.- Parameters:
jaxbContextBuilder
- the jaxb context builder
-
ReactiveJaxbDecoder
public ReactiveJaxbDecoder(JaxbContextBuilder jaxbContextBuilder, Set<Class<?>> ignoreReadingClasses) Instantiates a new Reactive jaxb decoder.- Parameters:
jaxbContextBuilder
- the jaxb context builderignoreReadingClasses
- the ignore reading classes
-
-
Method Details
-
setMaxInMemorySize
public void setMaxInMemorySize(int byteCount) Set the max number of bytes that can be buffered by this decoder. This is either the size of the entire input when decoding as a whole, or when using async parsing with Aalto XML, it is the size of one top-level XML tree. When the limit is exceeded,DataBufferLimitException
* is raised.By default this is set to 256K.
- Parameters:
byteCount
- the max number of bytes to buffer, or -1 for unlimited
-
getMaxInMemorySize
public int getMaxInMemorySize()Return theconfigured
byte count limit.- Returns:
- the max in memory size
-
canDecode
public boolean canDecode(@NonNull org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType) -
decode
@NonNull public reactor.core.publisher.Flux<Object> decode(@NonNull org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> inputStream, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints) -
decode
@NonNull public Object decode(org.springframework.core.io.buffer.DataBuffer dataBuffer, org.springframework.core.ResolvableType targetType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints) throws org.springframework.core.codec.DecodingException- Throws:
org.springframework.core.codec.DecodingException
-
decodeToMono
@NonNull public reactor.core.publisher.Mono<Object> decodeToMono(@NonNull org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer> input, @NonNull org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints)
-