Class FastJsonJsonView
- java.lang.Object
-
- org.springframework.context.support.ApplicationObjectSupport
-
- org.springframework.web.context.support.WebApplicationObjectSupport
-
- org.springframework.web.servlet.view.AbstractView
-
- com.alibaba.fastjson.support.spring.FastJsonJsonView
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.View
public class FastJsonJsonView extends org.springframework.web.servlet.view.AbstractViewFastjson for Spring MVC View.- Since:
- 1.2.9
- Author:
- libinsong1204@gmail.com, VictorZeng
- See Also:
AbstractView
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_CONTENT_TYPEdefault content typestatic StringDEFAULT_JSONP_CONTENT_TYPEDefault content type for JSONP: "application/javascript".
-
Constructor Summary
Constructors Constructor Description FastJsonJsonView()Set default param.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CharsetgetCharset()Deprecated.StringgetDateFormat()Deprecated.FastJsonConfiggetFastJsonConfig()SerializerFeature[]getFeatures()Deprecated.SerializeFilter[]getFilters()Deprecated.booleanisExtractValueFromSingleKeyModel()Check extractValueFromSingleKeyModel.voidsetCharset(Charset charset)Deprecated.voidsetDateFormat(String dateFormat)Deprecated.voidsetDisableCaching(boolean disableCaching)Disables caching of the generated JSON.voidsetExtractValueFromSingleKeyModel(boolean extractValueFromSingleKeyModel)Set extractValueFromSingleKeyModel.voidsetFastJsonConfig(FastJsonConfig fastJsonConfig)voidsetFeatures(SerializerFeature... features)Deprecated.voidsetFilters(SerializeFilter... filters)Deprecated.voidsetJsonpParameterNames(Set<String> jsonpParameterNames)Set JSONP request parameter names.voidsetRenderedAttributes(Set<String> renderedAttributes)Set renderedAttributes.voidsetSerializerFeature(SerializerFeature... features)Deprecated.voidsetUpdateContentLength(boolean updateContentLength)Whether to update the 'Content-Length' header of the response.-
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setRequestContextAttribute, toString
-
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
setServletContext
-
-
-
-
Field Detail
-
DEFAULT_CONTENT_TYPE
public static final String DEFAULT_CONTENT_TYPE
default content type- See Also:
- Constant Field Values
-
DEFAULT_JSONP_CONTENT_TYPE
public static final String DEFAULT_JSONP_CONTENT_TYPE
Default content type for JSONP: "application/javascript".- See Also:
- Constant Field Values
-
-
Method Detail
-
getFastJsonConfig
public FastJsonConfig getFastJsonConfig()
- Returns:
- the fastJsonConfig.
- Since:
- 1.2.11
-
setFastJsonConfig
public void setFastJsonConfig(FastJsonConfig fastJsonConfig)
- Parameters:
fastJsonConfig- the fastJsonConfig to set.- Since:
- 1.2.11
-
setSerializerFeature
@Deprecated public void setSerializerFeature(SerializerFeature... features)
Deprecated.Sets serializer feature.- Parameters:
features- the features- See Also:
FastJsonConfig.setSerializerFeatures(SerializerFeature...)
-
getCharset
@Deprecated public Charset getCharset()
Deprecated.Gets charset.- Returns:
- the charset
- See Also:
FastJsonConfig.getCharset()
-
setCharset
@Deprecated public void setCharset(Charset charset)
Deprecated.Sets charset.- Parameters:
charset- the charset- See Also:
FastJsonConfig.setCharset(Charset)
-
getDateFormat
@Deprecated public String getDateFormat()
Deprecated.Gets date format.- Returns:
- the date format
- See Also:
FastJsonConfig.getDateFormat()
-
setDateFormat
@Deprecated public void setDateFormat(String dateFormat)
Deprecated.Sets date format.- Parameters:
dateFormat- the date format- See Also:
FastJsonConfig.setDateFormat(String)
-
getFeatures
@Deprecated public SerializerFeature[] getFeatures()
Deprecated.Get features serializer feature [].- Returns:
- the serializer feature []
- See Also:
FastJsonConfig.getSerializerFeatures()
-
setFeatures
@Deprecated public void setFeatures(SerializerFeature... features)
Deprecated.Sets features.- Parameters:
features- the features- See Also:
FastJsonConfig.setSerializerFeatures(SerializerFeature...)
-
getFilters
@Deprecated public SerializeFilter[] getFilters()
Deprecated.Get filters serialize filter [].- Returns:
- the serialize filter []
- See Also:
FastJsonConfig.getSerializeFilters()
-
setFilters
@Deprecated public void setFilters(SerializeFilter... filters)
Deprecated.Sets filters.- Parameters:
filters- the filters- See Also:
FastJsonConfig.setSerializeFilters(SerializeFilter...)
-
setRenderedAttributes
public void setRenderedAttributes(Set<String> renderedAttributes)
Set renderedAttributes.- Parameters:
renderedAttributes- renderedAttributes
-
isExtractValueFromSingleKeyModel
public boolean isExtractValueFromSingleKeyModel()
Check extractValueFromSingleKeyModel.- Returns:
- extractValueFromSingleKeyModel
-
setExtractValueFromSingleKeyModel
public void setExtractValueFromSingleKeyModel(boolean extractValueFromSingleKeyModel)
Set extractValueFromSingleKeyModel.- Parameters:
extractValueFromSingleKeyModel-
-
setJsonpParameterNames
public void setJsonpParameterNames(Set<String> jsonpParameterNames)
Set JSONP request parameter names. Each time a request has one of those parameters, the resulting JSON will be wrapped into a function named as specified by the JSONP request parameter value.The parameter names configured by default are "jsonp" and "callback".
- Since:
- 4.1
- See Also:
- JSONP Wikipedia article
-
setDisableCaching
public void setDisableCaching(boolean disableCaching)
Disables caching of the generated JSON.Default is
true, which will prevent the client from caching the generated JSON.
-
setUpdateContentLength
public void setUpdateContentLength(boolean updateContentLength)
Whether to update the 'Content-Length' header of the response. When set totrue, the response is buffered in order to determine the content length and set the 'Content-Length' header of the response.The default setting is
false.
-
-