Class MappingJackson2XmlView
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractView
org.springframework.web.servlet.view.json.AbstractJackson2View
org.springframework.web.servlet.view.xml.MappingJackson2XmlView
- All Implemented Interfaces:
Aware, BeanNameAware, ApplicationContextAware, ServletContextAware, View
@Deprecated(since="7.0",
forRemoval=true)
public class MappingJackson2XmlView
extends AbstractJackson2View
Deprecated, for removal: This API element is subject to removal in a future version.
Spring MVC
View that renders XML content by serializing the model for the current request
using Jackson 2's XmlMapper.
The Object to be serialized is supplied as a parameter in the model. The first serializable
entry is used. Users can either specify a specific entry in the model via the
sourceKey property.
The default constructor uses the default configuration provided by Jackson2ObjectMapperBuilder.
- Since:
- 4.1
- Author:
- Sebastien Deleuze
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.The default content type for the view.Fields inherited from class AbstractJackson2View
updateContentLengthFields inherited from class ApplicationObjectSupport
loggerFields inherited from interface View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Construct a newMappingJackson2XmlViewusing default configuration provided byJackson2ObjectMapperBuilderand setting the content type toapplication/xml.MappingJackson2XmlView(com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper) Deprecated, for removal: This API element is subject to removal in a future version.Construct a newMappingJackson2XmlViewusing the providedXmlMapperand setting the content type toapplication/xml. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectfilterModel(Map<String, Object> model) Deprecated, for removal: This API element is subject to removal in a future version.Filter out undesired attributes from the given model.voidsetModelKey(String modelKey) Deprecated, for removal: This API element is subject to removal in a future version.Set the attribute in the model that should be rendered by this view.Methods inherited from class AbstractJackson2View
filterAndWrapModel, getEncoding, getObjectMapper, prepareResponse, renderMergedOutputModel, setDisableCaching, setEncoding, setObjectMapper, setPrettyPrint, setUpdateContentLength, writeContent, writePrefix, writeSuffixMethods inherited from class AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, formatViewName, generatesDownloadContent, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getRequestToExpose, getStaticAttributes, isExposePathVariables, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponseMethods inherited from class WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
DEFAULT_CONTENT_TYPE
Deprecated, for removal: This API element is subject to removal in a future version.The default content type for the view.- See Also:
-
-
Constructor Details
-
MappingJackson2XmlView
public MappingJackson2XmlView()Deprecated, for removal: This API element is subject to removal in a future version.Construct a newMappingJackson2XmlViewusing default configuration provided byJackson2ObjectMapperBuilderand setting the content type toapplication/xml. -
MappingJackson2XmlView
public MappingJackson2XmlView(com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper) Deprecated, for removal: This API element is subject to removal in a future version.Construct a newMappingJackson2XmlViewusing the providedXmlMapperand setting the content type toapplication/xml.- Since:
- 4.2.1
-
-
Method Details
-
setModelKey
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractJackson2ViewSet the attribute in the model that should be rendered by this view. When set, all other model attributes will be ignored.- Specified by:
setModelKeyin classAbstractJackson2View
-
filterModel
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:AbstractJackson2ViewFilter out undesired attributes from the given model. The return value can be either anotherMapor a single value object.- Specified by:
filterModelin classAbstractJackson2View- Parameters:
model- the model, as passed on toAbstractJackson2View.renderMergedOutputModel(Map, HttpServletRequest, HttpServletResponse)- Returns:
- the value to be rendered
-
JacksonXmlView