org.alfresco.repo.publishing
Class JaxbHttpMessageConverter
java.lang.Object
org.springframework.http.converter.AbstractHttpMessageConverter
org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
org.alfresco.repo.publishing.JaxbHttpMessageConverter
- All Implemented Interfaces:
- org.springframework.http.converter.HttpMessageConverter
public class JaxbHttpMessageConverter
- extends org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
- Since:
- 4.0
Fields inherited from class org.springframework.http.converter.AbstractHttpMessageConverter |
logger |
Method Summary |
boolean |
canRead(java.lang.Class clazz,
org.springframework.http.MediaType mediaType)
|
boolean |
canWrite(java.lang.Class clazz,
org.springframework.http.MediaType mediaType)
|
protected boolean |
canWrite(org.springframework.http.MediaType mediaType)
|
protected javax.xml.bind.Marshaller |
createMarshaller(java.lang.Class clazz)
Creates a new Marshaller for the given class. |
protected javax.xml.bind.Unmarshaller |
createUnmarshaller(java.lang.Class clazz)
Creates a new Unmarshaller for the given class. |
protected javax.xml.bind.JAXBContext |
getJaxbContext(java.lang.Class clazz)
Returns a JAXBContext for the given class. |
protected java.lang.Object |
readFromSource(java.lang.Class clazz,
org.springframework.http.HttpHeaders headers,
javax.xml.transform.Source source)
|
protected boolean |
supports(java.lang.Class clazz)
|
protected void |
writeToResult(java.lang.Object o,
org.springframework.http.HttpHeaders headers,
javax.xml.transform.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, getContentLength, getDefaultContentType, getSupportedMediaTypes, read, setSupportedMediaTypes, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JaxbHttpMessageConverter
public JaxbHttpMessageConverter()
JaxbHttpMessageConverter
public JaxbHttpMessageConverter(java.lang.String packagesToInclude)
- Create a JAXB message converter, specifying the Java packages it should use to find JAXB classes
- Parameters:
packagesToInclude
- A colon-separated list of package names.- See Also:
JAXBContext.newInstance(String)
canRead
public boolean canRead(java.lang.Class clazz,
org.springframework.http.MediaType mediaType)
- Specified by:
canRead
in interface org.springframework.http.converter.HttpMessageConverter
- Overrides:
canRead
in class org.springframework.http.converter.AbstractHttpMessageConverter
canWrite
public boolean canWrite(java.lang.Class clazz,
org.springframework.http.MediaType mediaType)
- Specified by:
canWrite
in interface org.springframework.http.converter.HttpMessageConverter
- Overrides:
canWrite
in class org.springframework.http.converter.AbstractHttpMessageConverter
supports
protected boolean supports(java.lang.Class clazz)
- Specified by:
supports
in class org.springframework.http.converter.AbstractHttpMessageConverter
canWrite
protected boolean canWrite(org.springframework.http.MediaType mediaType)
- Overrides:
canWrite
in class org.springframework.http.converter.AbstractHttpMessageConverter
readFromSource
protected java.lang.Object readFromSource(java.lang.Class clazz,
org.springframework.http.HttpHeaders headers,
javax.xml.transform.Source source)
throws java.io.IOException
- Specified by:
readFromSource
in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
- Throws:
java.io.IOException
writeToResult
protected void writeToResult(java.lang.Object o,
org.springframework.http.HttpHeaders headers,
javax.xml.transform.Result result)
throws java.io.IOException
- Specified by:
writeToResult
in class org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
- Throws:
java.io.IOException
createMarshaller
protected final javax.xml.bind.Marshaller createMarshaller(java.lang.Class clazz)
- Creates a new
Marshaller
for the given class.
- Parameters:
clazz
- the class to create the marshaller for
- Returns:
- the
Marshaller
- Throws:
org.springframework.http.converter.HttpMessageConversionException
- in case of JAXB errors
createUnmarshaller
protected final javax.xml.bind.Unmarshaller createUnmarshaller(java.lang.Class clazz)
throws javax.xml.bind.JAXBException
- Creates a new
Unmarshaller
for the given class.
- Parameters:
clazz
- the class to create the unmarshaller for
- Returns:
- the
Unmarshaller
- Throws:
org.springframework.http.converter.HttpMessageConversionException
- in case of JAXB errors
javax.xml.bind.JAXBException
getJaxbContext
protected final javax.xml.bind.JAXBContext getJaxbContext(java.lang.Class clazz)
- Returns a
JAXBContext
for the given class.
- Parameters:
clazz
- the class to return the context for
- Returns:
- the
JAXBContext
- Throws:
org.springframework.http.converter.HttpMessageConversionException
- in case of JAXB errors
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.