Package com.emc.documentum.rest.wire.xml

# Class AnnotatedXmlMessageConverter<T>

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
com.emc.documentum.rest.wire.RestAbstractHttpMessageConverter<T>
com.emc.documentum.rest.wire.xml.AnnotatedXmlMessageConverter<T>

Type Parameters:
  `T` - the model class

All Implemented Interfaces:
  `org.springframework.http.converter.HttpMessageConverter<T>`

public class AnnotatedXmlMessageConverter<T> extends RestAbstractHttpMessageConverter<T>
An implementation of Spring message converter which reads and writes XML messages for the annotated models. The model class for the read and write must be annotated from `SerializableType` or extends from a class with this annotation.

- ## Field Summary

  ### Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

  `logger`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AnnotatedXmlMessageConverter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `canRead(Class<?> clazz, org.springframework.http.MediaType mediaType)`
  Specifies whether the model class type and the media type is compatible for read.
  `protected boolean`
  `canRead(org.springframework.http.MediaType mediaType)`
  Specifies whether the media type is compatible for read.
  `boolean`
  `canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)`
  Specifies whether the model class type and the media type is compatible for write.
  `protected boolean`
  `canWrite(org.springframework.http.MediaType mediaType)`
  Specifies whether the media type is compatible for write.
  `protected T`
  `readInternal(Class<? extends T> clazz, org.springframework.http.HttpInputMessage inputMessage)`
  Writer internal output http message.
  `void`
  `setDefaultMediaType(String defaultMediaType)`
  Sets the default media type.
  `void`
  `setReadableMediaTypes(List<org.springframework.http.MediaType> readableMediaTypes)`
  Set the list of `MediaType` readable media types supported by this converter.
  `void`
  `setReader(StreamingMessageReader reader)`
  Specifies the message reader.
  `void`
  `setUniversal(boolean universal)`
  Specifies the message converter to support all writable media types when the managed media type is XML.
  `void`
  `setWriter(StreamingMessageWriter writer)`
  Specifies the message writer.
  `protected boolean`
  `supports(Class<?> clazz)`
  Check whether the class has the annotation `SerializableType` or extends from a class with the annotation.
  `protected void`
  `writeInternal(T t, org.springframework.http.HttpOutputMessage outputMessage)`
  Writer internal output http message.

  ### Methods inherited from class com.emc.documentum.rest.wire.RestAbstractHttpMessageConverter

  `addDefaultHeaders`

  ### Methods inherited from class org.springframework.http.converter.AbstractHttpMessageConverter

  `getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, supportsRepeatableWrites, write`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.springframework.http.converter.HttpMessageConverter

  `getSupportedMediaTypes`

- ## Constructor Details

  - ### AnnotatedXmlMessageConverter

    public AnnotatedXmlMessageConverter()

- ## Method Details

  - ### setReader

    public void setReader(StreamingMessageReader reader)
    Specifies the message reader.
    Parameters:
      `reader` - the message reader.
    See Also:
      - `AnnotatedXmlMessageReader`

  - ### setWriter

    public void setWriter(StreamingMessageWriter writer)
    Specifies the message writer.
    Parameters:
      `writer` - the message writer.
    See Also:
      - `AnnotatedXmlMessageWriter`

  - ### setUniversal

    public void setUniversal(boolean universal)
    Specifies the message converter to support all writable media types when the managed media type is XML.
    Parameters:
      `universal` - `true` indicates to be universal; `false` for otherwise.

  - ### setDefaultMediaType

    public void setDefaultMediaType(String defaultMediaType)
    Sets the default media type. The default media type is set to the response of write when the original response content type is not meaningful for this message converter.
    Parameters:
      `defaultMediaType` - the default media type \

  - ### setReadableMediaTypes

    public void setReadableMediaTypes(List<org.springframework.http.MediaType> readableMediaTypes)
    Set the list of `MediaType` readable media types supported by this converter. The readable media types will override the default supported media types for deserialization.
    Parameters:
      `readableMediaTypes` - readable media types

  - ### supports

    protected boolean supports(Class<?> clazz)
    Check whether the class has the annotation `SerializableType` or extends from a class with the annotation.
    Specified by:
      `supports` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `clazz` - the model class
    Returns:
      true if it or its parent class has the annotation `SerializableType`.

  - ### canRead

    protected boolean canRead(org.springframework.http.MediaType mediaType)
    Specifies whether the media type is compatible for read.
    Overrides:
      `canRead` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `mediaType` - the requested media type
    Returns:
      true if the converter can read this media type; false otherwise.

  - ### canRead

    public boolean canRead(Class<?> clazz, org.springframework.http.MediaType mediaType)
    Specifies whether the model class type and the media type is compatible for read.
    Specified by:
      `canRead` in interface `org.springframework.http.converter.HttpMessageConverter<T>`
    Overrides:
      `canRead` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `clazz` - the model class
      `mediaType` - the requested media type
    Returns:
      true if the converter can read this media type; false otherwise.

  - ### canWrite

    protected boolean canWrite(org.springframework.http.MediaType mediaType)
    Specifies whether the media type is compatible for write.
    Overrides:
      `canWrite` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `mediaType` - the requested media type
    Returns:
      true if the converter can write this media type; false otherwise.

  - ### canWrite

    public boolean canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)
    Specifies whether the model class type and the media type is compatible for write.
    Specified by:
      `canWrite` in interface `org.springframework.http.converter.HttpMessageConverter<T>`
    Overrides:
      `canWrite` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `clazz` - the model class
      `mediaType` - the requested media type
    Returns:
      true if the converter can write this media type; false otherwise.

  - ### readInternal

    protected T readInternal(Class<? extends T> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException
    Writer internal output http message.
    Specified by:
      `readInternal` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `clazz` - the model class
      `inputMessage` - the servlet http input message
    Returns:
      the model instance
    Throws:
      `IOException` - when there are errors in reading the message

  - ### writeInternal

    protected void writeInternal(T t, org.springframework.http.HttpOutputMessage outputMessage) throws IOException
    Writer internal output http message.
    Specified by:
      `writeInternal` in class `org.springframework.http.converter.AbstractHttpMessageConverter<T>`
    Parameters:
      `t` - the model instance
      `outputMessage` - the servlet http output message
    Throws:
      `IOException` - when there are errors in reading the message