Class Jaxb2XmlDecoder
java.lang.Object
org.springframework.core.codec.AbstractDecoder<Object>
org.springframework.http.codec.xml.Jaxb2XmlDecoder
- All Implemented Interfaces:
org.springframework.core.codec.Decoder<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:
-
Field Summary
Fields inherited from class org.springframework.core.codec.AbstractDecoder
logger -
Constructor Summary
ConstructorsConstructorDescriptionJaxb2XmlDecoder(org.springframework.util.MimeType... supportedMimeTypes) Create aJaxb2XmlDecoderwith the specified MIME types. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType) reactor.core.publisher.Flux<Object> decode(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(org.springframework.core.io.buffer.DataBuffer dataBuffer, org.springframework.core.ResolvableType targetType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints) reactor.core.publisher.Mono<Object> decodeToMono(Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType, @Nullable Map<String, Object> hints) intReturn theconfiguredbyte count limit.Function<jakarta.xml.bind.Unmarshaller, jakarta.xml.bind.Unmarshaller> Return the configured processor for customizing Unmarshaller instances.voidsetMaxInMemorySize(int byteCount) Set the max number of bytes that can be buffered by this decoder.voidsetUnmarshallerProcessor(Function<jakarta.xml.bind.Unmarshaller, jakarta.xml.bind.Unmarshaller> processor) Configure a processor function to customize Unmarshaller instances.Methods inherited from class org.springframework.core.codec.AbstractDecoder
getDecodableMimeTypes, getLogger, setLoggerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.codec.Decoder
getDecodableMimeTypes
-
Constructor Details
-
Jaxb2XmlDecoder
public Jaxb2XmlDecoder() -
Jaxb2XmlDecoder
public Jaxb2XmlDecoder(org.springframework.util.MimeType... supportedMimeTypes) Create aJaxb2XmlDecoderwith the specified MIME types.- Parameters:
supportedMimeTypes- supported MIME types- Since:
- 5.1.9
-
-
Method Details
-
setUnmarshallerProcessor
public void setUnmarshallerProcessor(Function<jakarta.xml.bind.Unmarshaller, jakarta.xml.bind.Unmarshaller> processor) Configure a processor function to customize Unmarshaller instances.- Parameters:
processor- the function to use- Since:
- 5.1.3
-
getUnmarshallerProcessor
public Function<jakarta.xml.bind.Unmarshaller, jakarta.xml.bind.Unmarshaller> getUnmarshallerProcessor()Return the configured processor for customizing Unmarshaller instances.- Since:
- 5.1.3
-
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,DataBufferLimitExceptionis raised.By default this is set to 256K.
- Parameters:
byteCount- the max number of bytes to buffer, or -1 for unlimited- Since:
- 5.1.11
-
getMaxInMemorySize
-
canDecode
public boolean canDecode(org.springframework.core.ResolvableType elementType, @Nullable org.springframework.util.MimeType mimeType) -
decode
-
decodeToMono
-
decode
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
-