Class Jaxb2HttpMessageConverter

java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter<T>
org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>
org.bremersee.pagebuilder.integration.Jaxb2HttpMessageConverter
All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<Object>

public class Jaxb2HttpMessageConverter extends org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>
The jaxb 2 http message converter.
Author:
Arjen Poutsma, Juergen Hoeller, Rossen Stoyanchev. Christian Bremer
See Also:
  • Jaxb2RootElementHttpMessageConverter
  • Field Summary

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

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    Jaxb2HttpMessageConverter(org.bremersee.xml.JaxbContextBuilder jaxbContextBuilder)
    Instantiates a new Jaxb 2 http message converter.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRead(Class<?> clazz, org.springframework.http.MediaType mediaType)
     
    boolean
    canWrite(Class<?> clazz, org.springframework.http.MediaType mediaType)
     
    protected Object
    readFromSource(Class<?> clazz, org.springframework.http.HttpHeaders headers, Source source)
     
    protected boolean
    supports(Class<?> clazz)
     
    protected void
    writeToResult(Object o, org.springframework.http.HttpHeaders headers, Result result)
     

    Methods inherited from class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter

    readInternal, transform, writeInternal

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

    addDefaultHeaders, canRead, canWrite, 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

    • Jaxb2HttpMessageConverter

      public Jaxb2HttpMessageConverter(org.bremersee.xml.JaxbContextBuilder jaxbContextBuilder)
      Instantiates a new Jaxb 2 http message converter.
      Parameters:
      jaxbContextBuilder - the jaxb context builder
  • Method Details

    • canRead

      public boolean canRead(@NonNull Class<?> clazz, @Nullable org.springframework.http.MediaType mediaType)
      Specified by:
      canRead in interface org.springframework.http.converter.HttpMessageConverter<Object>
      Overrides:
      canRead in class org.springframework.http.converter.AbstractHttpMessageConverter<Object>
    • canWrite

      public boolean canWrite(@NonNull Class<?> clazz, @Nullable org.springframework.http.MediaType mediaType)
      Specified by:
      canWrite in interface org.springframework.http.converter.HttpMessageConverter<Object>
      Overrides:
      canWrite in class org.springframework.http.converter.AbstractHttpMessageConverter<Object>
    • supports

      protected boolean supports(@NonNull Class<?> clazz)
      Specified by:
      supports in class org.springframework.http.converter.AbstractHttpMessageConverter<Object>
    • readFromSource

      @NonNull protected Object readFromSource(@NonNull Class<?> clazz, @NonNull org.springframework.http.HttpHeaders headers, @NonNull Source source) throws Exception
      Specified by:
      readFromSource in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>
      Throws:
      Exception
    • writeToResult

      protected void writeToResult(@NonNull Object o, org.springframework.http.HttpHeaders headers, @NonNull Result result) throws Exception
      Specified by:
      writeToResult in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>
      Throws:
      Exception