public abstract class ViewResolverSupport extends java.lang.Object implements ApplicationContextAware, Ordered
ViewResolver
implementations with shared properties.Modifier and Type | Field and Description |
---|---|
private ApplicationContext |
applicationContext |
static MediaType |
DEFAULT_CONTENT_TYPE |
private java.nio.charset.Charset |
defaultCharset |
private java.util.List<MediaType> |
mediaTypes |
private int |
order |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
ViewResolverSupport() |
Modifier and Type | Method and Description |
---|---|
ApplicationContext |
getApplicationContext() |
java.nio.charset.Charset |
getDefaultCharset()
Return the default charset, used when the
content type does not contain one.
|
int |
getOrder()
Return the order in which this
ViewResolver is evaluated. |
java.util.List<MediaType> |
getSupportedMediaTypes()
Return the configured media types supported by this view.
|
void |
setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in.
|
void |
setDefaultCharset(java.nio.charset.Charset defaultCharset)
Set the default charset for this view, used when the
content type does not contain one.
|
void |
setOrder(int order)
Set the order in which this
ViewResolver
is evaluated. |
void |
setSupportedMediaTypes(java.util.List<MediaType> supportedMediaTypes)
Set the supported media types for this view.
|
public static final MediaType DEFAULT_CONTENT_TYPE
private java.util.List<MediaType> mediaTypes
private java.nio.charset.Charset defaultCharset
private ApplicationContext applicationContext
private int order
public void setSupportedMediaTypes(java.util.List<MediaType> supportedMediaTypes)
public java.util.List<MediaType> getSupportedMediaTypes()
public void setDefaultCharset(java.nio.charset.Charset defaultCharset)
public java.nio.charset.Charset getDefaultCharset()
public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware
Invoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
and
MessageSourceAware
, if applicable.
setApplicationContext
in interface ApplicationContextAware
applicationContext
- the ApplicationContext object to be used by this objectBeanInitializationException
public ApplicationContext getApplicationContext()
public void setOrder(int order)
ViewResolver
is evaluated.public int getOrder()
ViewResolver
is evaluated.getOrder
in interface Ordered
Ordered.HIGHEST_PRECEDENCE
,
Ordered.LOWEST_PRECEDENCE