类 AbstractJaxb2HttpMessageConverter<T>
- java.lang.Object
- org.springframework.http.converter.AbstractHttpMessageConverter<T>
- org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter<T>
- org.springframework.http.converter.xml.AbstractJaxb2HttpMessageConverter<T>
- 所有已实现的接口:
HttpMessageConverter<T>
public abstract class AbstractJaxb2HttpMessageConverter<T> extends AbstractXmlHttpMessageConverter<T>
Abstract base class forHttpMessageConvertersthat use JAXB2. CreatesJAXBContextobject lazily.- 从以下版本开始:
- 3.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
字段概要
从类继承的字段 org.springframework.http.converter.AbstractHttpMessageConverter
logger
构造器概要
构造器 构造器 说明 AbstractJaxb2HttpMessageConverter()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected MarshallercreateMarshaller(Class<?> clazz)Create a newMarshallerfor the given class.protected UnmarshallercreateUnmarshaller(Class<?> clazz)Create a newUnmarshallerfor the given class.protected voidcustomizeMarshaller(Marshaller marshaller)Customize theMarshallercreated by this message converter before using it to write the object to the output.protected voidcustomizeUnmarshaller(Unmarshaller unmarshaller)Customize theUnmarshallercreated by this message converter before using it to read the object from the input.protected JAXBContextgetJaxbContext(Class<?> clazz)Return aJAXBContextfor the given class.从类继承的方法 org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter
readFromSource, readInternal, transform, writeInternal, writeToResult
从类继承的方法 org.springframework.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canRead, canWrite, canWrite, getContentLength, getDefaultCharset, getDefaultContentType, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, supports, write
构造器详细资料
AbstractJaxb2HttpMessageConverter
public AbstractJaxb2HttpMessageConverter()
方法详细资料
createMarshaller
protected final Marshaller createMarshaller(Class<?> clazz)
Create a newMarshallerfor the given class.- 参数:
clazz- the class to create the marshaller for- 返回:
- the
Marshaller - 抛出:
HttpMessageConversionException- in case of JAXB errors
customizeMarshaller
protected void customizeMarshaller(Marshaller marshaller)
Customize theMarshallercreated by this message converter before using it to write the object to the output.- 参数:
marshaller- the marshaller to customize- 从以下版本开始:
- 4.0.3
- 另请参阅:
createMarshaller(Class)
createUnmarshaller
protected final Unmarshaller createUnmarshaller(Class<?> clazz)
Create a newUnmarshallerfor the given class.- 参数:
clazz- the class to create the unmarshaller for- 返回:
- the
Unmarshaller - 抛出:
HttpMessageConversionException- in case of JAXB errors
customizeUnmarshaller
protected void customizeUnmarshaller(Unmarshaller unmarshaller)
Customize theUnmarshallercreated by this message converter before using it to read the object from the input.- 参数:
unmarshaller- the unmarshaller to customize- 从以下版本开始:
- 4.0.3
- 另请参阅:
createUnmarshaller(Class)
getJaxbContext
protected final JAXBContext getJaxbContext(Class<?> clazz)
Return aJAXBContextfor the given class.- 参数:
clazz- the class to return the context for- 返回:
- the
JAXBContext - 抛出:
HttpMessageConversionException- in case of JAXB errors