org.jasig.springframework.http.converter.xml
Class JaxbMarshallingHttpMessageConverter

java.lang.Object
  extended by org.springframework.http.converter.AbstractHttpMessageConverter<T>
      extended by org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>
          extended by org.jasig.springframework.http.converter.xml.JaxbMarshallingHttpMessageConverter
All Implemented Interfaces:
org.springframework.http.converter.HttpMessageConverter<Object>

public class JaxbMarshallingHttpMessageConverter
extends org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<Object>

XML message converter that uses a JAXBContext directly. The Class specified to readFromSource(Class, HttpHeaders, Source) is passed to the Unmarshaller.unmarshal(Source, Class) method to help with parsing of XML that doesn't include namespace information. Note that supports(Class) returns true for ALL Classes so this converter should only be used in a limited scope

Author:
Eric Dalquist

Field Summary
 
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter
logger
 
Constructor Summary
JaxbMarshallingHttpMessageConverter(JAXBContext jaxbContext)
           
 
Method Summary
protected  Object readFromSource(Class<?> clazz, org.springframework.http.HttpHeaders headers, Source source)
           
 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
canRead, canRead, canWrite, canWrite, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxbMarshallingHttpMessageConverter

public JaxbMarshallingHttpMessageConverter(JAXBContext jaxbContext)
Method Detail

supports

public boolean supports(Class<?> clazz)
Specified by:
supports in class org.springframework.http.converter.AbstractHttpMessageConverter<Object>

readFromSource

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

writeToResult

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


Copyright © 2013 Jasig. All Rights Reserved.