Support decoding Mono in Jaxb2XmlDecoder
Issue: SPR-16759
This commit is contained in:
@@ -107,6 +107,12 @@ public class Jaxb2XmlDecoder extends AbstractDecoder<Object> {
|
||||
return splitEvents.map(events -> unmarshal(events, outputClass));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Object> decodeToMono(Publisher<DataBuffer> inputStream, ResolvableType elementType,
|
||||
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {
|
||||
return decode(inputStream, elementType, mimeType, hints).singleOrEmpty();
|
||||
}
|
||||
|
||||
private Object unmarshal(List<XMLEvent> events, Class<?> outputClass) {
|
||||
try {
|
||||
Unmarshaller unmarshaller = this.jaxbContexts.createUnmarshaller(outputClass);
|
||||
|
||||
Reference in New Issue
Block a user