public class Jaxb2XmlDecoder extends AbstractDecoder<Object>
Objects (POJOs).Jaxb2XmlEncoderlogger| Constructor and Description |
|---|
Jaxb2XmlDecoder() |
Jaxb2XmlDecoder(MimeType... supportedMimeTypes)
Create a
Jaxb2XmlDecoder with the specified MIME types. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecode(ResolvableType elementType,
MimeType mimeType)
Whether the decoder supports the given target element type and the MIME
type of the source stream.
|
Object |
decode(DataBuffer dataBuffer,
ResolvableType targetType,
MimeType mimeType,
Map<String,Object> hints)
Decode a data buffer to an Object of type T.
|
reactor.core.publisher.Flux<Object> |
decode(Publisher<DataBuffer> inputStream,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Flux of T. |
reactor.core.publisher.Mono<Object> |
decodeToMono(Publisher<DataBuffer> input,
ResolvableType elementType,
MimeType mimeType,
Map<String,Object> hints)
Decode a
DataBuffer input stream into a Mono of T. |
int |
getMaxInMemorySize()
Return the
configured byte count limit. |
Function<Unmarshaller,Unmarshaller> |
getUnmarshallerProcessor()
Return the configured processor for customizing Unmarshaller instances.
|
void |
setMaxInMemorySize(int byteCount)
Set the max number of bytes that can be buffered by this decoder.
|
void |
setUnmarshallerProcessor(Function<Unmarshaller,Unmarshaller> processor)
Configure a processor function to customize Unmarshaller instances.
|
getDecodableMimeTypes, getLogger, setLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDecodableMimeTypespublic Jaxb2XmlDecoder()
public Jaxb2XmlDecoder(MimeType... supportedMimeTypes)
Jaxb2XmlDecoder with the specified MIME types.supportedMimeTypes - supported MIME typespublic void setUnmarshallerProcessor(Function<Unmarshaller,Unmarshaller> processor)
processor - the function to usepublic Function<Unmarshaller,Unmarshaller> getUnmarshallerProcessor()
public void setMaxInMemorySize(int byteCount)
DataBufferLimitException is raised.
By default this is set to 256K.
byteCount - the max number of bytes to buffer, or -1 for unlimitedpublic int getMaxInMemorySize()
configured byte count limit.public boolean canDecode(ResolvableType elementType, @Nullable MimeType mimeType)
DecodercanDecode in interface Decoder<Object>canDecode in class AbstractDecoder<Object>elementType - the target element type for the output streammimeType - the mime type associated with the stream to decode
(can be null if not specified)true if supported, false otherwisepublic reactor.core.publisher.Flux<Object> decode(Publisher<DataBuffer> inputStream, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
DecoderDataBuffer input stream into a Flux of T.inputStream - the DataBuffer input stream to decodeelementType - 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 decodepublic reactor.core.publisher.Mono<Object> decodeToMono(Publisher<DataBuffer> input, ResolvableType elementType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
DecoderDataBuffer input stream into a Mono of T.decodeToMono in interface Decoder<Object>decodeToMono in class AbstractDecoder<Object>input - the DataBuffer input stream to decodeelementType - 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 decodepublic Object decode(DataBuffer dataBuffer, ResolvableType targetType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints) throws DecodingException
DecoderdataBuffer - the DataBuffer to decodetargetType - the expected output typemimeType - the MIME type associated with the datahints - additional information about how to do decodenullDecodingException