T - the element typepublic abstract class AbstractEncoder<T> extends Object implements Encoder<T>
Encoder implementations.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractEncoder(MimeType... supportedMimeTypes) |
| 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.
|
List<MimeType> |
getEncodableMimeTypes()
Return the list of MIME types supported by this Encoder.
|
Log |
getLogger()
Return the currently configured Logger.
|
void |
setLogger(Log logger)
Set an alternative logger to use than the one based on the class name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencode, encodeValue, getEncodableMimeTypesprotected Log logger
protected AbstractEncoder(MimeType... supportedMimeTypes)
public void setLogger(Log logger)
logger - the logger to usepublic Log getLogger()
public List<MimeType> getEncodableMimeTypes()
EncodercanEncode(elementType, null). The list may also exclude MIME types
supported only for a specific element type. Alternatively, use
Encoder.getEncodableMimeTypes(ResolvableType) for a more precise list.getEncodableMimeTypes in interface Encoder<T>public boolean canEncode(ResolvableType elementType, @Nullable MimeType mimeType)
Encoder