Class MessageSourceResolvableHttpMessageConverter

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.context.MessageSourceResolvable>
de.odrotbohm.spring.web.mvc.MessageSourceResolvableHttpMessageConverter
All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<org.springframework.context.MessageSourceResolvable>

public class MessageSourceResolvableHttpMessageConverter extends org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.context.MessageSourceResolvable>
An HttpMessageConverter that immediately renders MessageSourceResolvable instances returned from a Spring MVC controller as plain text if MediaType.TEXT_PLAIN is requested.
Author:
Oliver Drotbohm
  • Field Summary

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

    logger
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    canRead(org.springframework.http.MediaType mediaType)
     
    protected org.springframework.context.MessageSourceResolvable
    readInternal(Class<? extends org.springframework.context.MessageSourceResolvable> clazz, org.springframework.http.HttpInputMessage inputMessage)
     
    protected boolean
    supports(Class<?> clazz)
     
    protected void
    writeInternal(org.springframework.context.MessageSourceResolvable t, org.springframework.http.HttpOutputMessage outputMessage)
     

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

    addDefaultHeaders, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, 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
  • Method Details

    • supports

      protected boolean supports(Class<?> clazz)
      Specified by:
      supports in class org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.context.MessageSourceResolvable>
    • writeInternal

      protected void writeInternal(org.springframework.context.MessageSourceResolvable t, org.springframework.http.HttpOutputMessage outputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotWritableException
      Specified by:
      writeInternal in class org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.context.MessageSourceResolvable>
      Throws:
      IOException
      org.springframework.http.converter.HttpMessageNotWritableException
    • canRead

      protected boolean canRead(org.springframework.http.MediaType mediaType)
      Overrides:
      canRead in class org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.context.MessageSourceResolvable>
    • readInternal

      protected org.springframework.context.MessageSourceResolvable readInternal(Class<? extends org.springframework.context.MessageSourceResolvable> clazz, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
      Specified by:
      readInternal in class org.springframework.http.converter.AbstractHttpMessageConverter<org.springframework.context.MessageSourceResolvable>
      Throws:
      IOException
      org.springframework.http.converter.HttpMessageNotReadableException