public class Jaxb2XmlEncoder extends AbstractSingleValueEncoder<Object>
@XmlElements
and
@XmlElement
can be used
to specify how collections should be marshalled.
Jaxb2XmlDecoder
logger
Constructor and Description |
---|
Jaxb2XmlEncoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
canEncode(ResolvableType elementType,
MimeType mimeType)
Whether the encoder supports the given source element type and the MIME
type for the output stream.
|
protected reactor.core.publisher.Flux<DataBuffer> |
encode(Object value,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints)
Encode
T to an output DataBuffer stream. |
DataBuffer |
encodeValue(Object value,
DataBufferFactory bufferFactory,
ResolvableType valueType,
MimeType mimeType,
Map<String,Object> hints)
Encode an Object of type T to a data buffer.
|
Function<Marshaller,Marshaller> |
getMarshallerProcessor()
Return the configured processor for customizing Marshaller instances.
|
void |
setMarshallerProcessor(Function<Marshaller,Marshaller> processor)
Configure a processor function to customize Marshaller instances.
|
encode
getEncodableMimeTypes, getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEncodableMimeTypes
public void setMarshallerProcessor(Function<Marshaller,Marshaller> processor)
processor
- the function to usepublic Function<Marshaller,Marshaller> getMarshallerProcessor()
public boolean canEncode(ResolvableType elementType, @Nullable MimeType mimeType)
Encoder
protected reactor.core.publisher.Flux<DataBuffer> encode(Object value, DataBufferFactory bufferFactory, ResolvableType valueType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
AbstractSingleValueEncoder
T
to an output DataBuffer
stream.encode
in class AbstractSingleValueEncoder<Object>
value
- the value to processbufferFactory
- a buffer factory used to create the outputvalueType
- the stream element type to processmimeType
- the mime type to processhints
- additional information about how to do decode, optionalpublic DataBuffer encodeValue(Object value, DataBufferFactory bufferFactory, ResolvableType valueType, @Nullable MimeType mimeType, @Nullable Map<String,Object> hints)
Encoder
By default this method raises UnsupportedOperationException
and it is expected that some encoders cannot produce a single buffer or
cannot do so synchronously (e.g. encoding a Resource
).
value
- the value to be encodedbufferFactory
- for creating the output DataBuffer
valueType
- the type for the value being encodedmimeType
- the MIME type for the output content (optional)hints
- additional information about how to encode