Class XmlEventDecoder
java.lang.Object
org.springframework.core.codec.AbstractDecoder<XMLEvent>
org.springframework.http.codec.xml.XmlEventDecoder
- All Implemented Interfaces:
org.springframework.core.codec.Decoder<XMLEvent>
Decodes a
DataBuffer stream into a stream of XMLEvents.
Given the following XML:
<root>
<child>foo</child>
<child>bar</child>
</root>
this decoder will produce a Flux with the following events:
StartDocumentStartElementrootStartElementchildCharactersfooEndElementchildStartElementchildCharactersbarEndElementchildEndElementroot
Note that this decoder is not registered by default but is used internally by other decoders which are registered by default.
- Since:
- 5.0
- Author:
- Arjen Poutsma, Sam Brannen
-
Field Summary
Fields inherited from class org.springframework.core.codec.AbstractDecoder
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Flux<XMLEvent>decode(Publisher<org.springframework.core.io.buffer.DataBuffer> input, org.springframework.core.ResolvableType elementType, org.springframework.util.MimeType mimeType, Map<String, Object> hints) intReturn theconfiguredbyte count limit.voidsetMaxInMemorySize(int byteCount) Set the max number of bytes that can be buffered by this decoder.Methods inherited from class org.springframework.core.codec.AbstractDecoder
canDecode, decodeToMono, getDecodableMimeTypes, getLogger, setLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.codec.Decoder
decode, getDecodableMimeTypes
-
Constructor Details
-
XmlEventDecoder
public XmlEventDecoder()
-
-
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 the entire input when decoding as a whole, or when using async parsing via Aalto XML, it is size 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
public int getMaxInMemorySize()Return theconfiguredbyte count limit.- Since:
- 5.1.11
-
decode
-