类 XsltViewResolver
- 所有已实现的接口:
cn.taketoday.beans.factory.Aware,cn.taketoday.context.ApplicationContextAware,cn.taketoday.core.Ordered,ViewResolver
ViewResolver implementation that
resolves instances of XsltView by translating the supplied view name
into the URL of the XSLT stylesheet.- 从以下版本开始:
- 4.0
- 作者:
- Rob Harrop, Juergen Hoeller
-
嵌套类概要
从类继承的嵌套类/接口 cn.taketoday.web.view.AbstractCachingViewResolver
AbstractCachingViewResolver.CacheFilter -
字段概要
字段修饰符和类型字段说明private booleanprivate ErrorListenerprivate booleanprivate Propertiesprivate Stringprivate URIResolver从类继承的字段 cn.taketoday.web.view.UrlBasedViewResolver
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX从类继承的字段 cn.taketoday.web.view.AbstractCachingViewResolver
DEFAULT_CACHE_FILTER, DEFAULT_CACHE_LIMIT, UNRESOLVED_VIEW从类继承的字段 cn.taketoday.context.support.ApplicationObjectSupport
applicationContext, log, messageSourceAccessor从接口继承的字段 cn.taketoday.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected AbstractUrlBasedViewCreates a new View instance of the specified view class and configures it.protected AbstractUrlBasedViewInstantiate the specified view class.protected Class<?>Return the required type of view for this resolver.voidsetCacheTemplates(boolean cacheTemplates) Turn on/off the caching of the XSLT templates.voidsetErrorListener(ErrorListener errorListener) Set an implementation of theErrorListenerinterface for custom handling of transformation errors and warnings.voidsetIndent(boolean indent) Set whether the XSLT transformer may add additional whitespace when outputting the result tree.voidsetOutputProperties(Properties outputProperties) Set arbitrary transformer output properties to be applied to the stylesheet.voidsetSourceKey(String sourceKey) Set the name of the model attribute that represents the XSLT Source.voidsetUriResolver(URIResolver uriResolver) Set the URIResolver used in the transform.从类继承的方法 cn.taketoday.web.view.UrlBasedViewResolver
applyLifecycleMethods, canHandle, createView, getAttributesMap, getCacheKey, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposeOutputRedirectModel, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames从类继承的方法 cn.taketoday.web.view.AbstractCachingViewResolver
clearCache, getCacheFilter, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheFilter, setCacheLimit, setCacheUnresolved从类继承的方法 cn.taketoday.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext, unwrapContext, unwrapFactory
-
字段详细资料
-
sourceKey
-
uriResolver
-
errorListener
-
indent
private boolean indent -
outputProperties
-
cacheTemplates
private boolean cacheTemplates
-
-
构造器详细资料
-
XsltViewResolver
public XsltViewResolver()This resolver requiresXsltView.
-
-
方法详细资料
-
setSourceKey
Set the name of the model attribute that represents the XSLT Source. If not specified, the model map will be searched for a matching value type.The following source types are supported out of the box:
Source,Document,Node,Reader,InputStreamandResource. -
setUriResolver
Set the URIResolver used in the transform.The URIResolver handles calls to the XSLT
document()function. -
setErrorListener
Set an implementation of theErrorListenerinterface for custom handling of transformation errors and warnings.If not set, a default
SimpleTransformErrorListeneris used that simply logs warnings using the logger instance of the view class, and rethrows errors to discontinue the XML transformation. -
setIndent
public void setIndent(boolean indent) Set whether the XSLT transformer may add additional whitespace when outputting the result tree.Default is
true(on); set this tofalse(off) to not specify an "indent" key, leaving the choice up to the stylesheet.- 另请参阅:
-
setOutputProperties
Set arbitrary transformer output properties to be applied to the stylesheet.Any values specified here will override defaults that this view sets programmatically.
-
setCacheTemplates
public void setCacheTemplates(boolean cacheTemplates) Turn on/off the caching of the XSLT templates.The default value is "true". Only set this to "false" in development, where caching does not seriously impact performance.
-
requiredViewClass
从类复制的说明:UrlBasedViewResolverReturn the required type of view for this resolver. This implementation returnsAbstractUrlBasedView. -
instantiateView
从类复制的说明:UrlBasedViewResolverInstantiate the specified view class.The default implementation uses reflection to instantiate the class.
- 覆盖:
instantiateView在类中UrlBasedViewResolver- 返回:
- a new instance of the view class
- 另请参阅:
-
buildView
从类复制的说明:UrlBasedViewResolverCreates a new View instance of the specified view class and configures it. Does not perform any lookup for pre-defined View instances.Framework lifecycle methods as defined by the bean container do not have to be called here; those will be applied by the
loadViewmethod after this method returns.Subclasses will typically call
super.buildView(viewName)first, before setting further properties themselves.loadViewwill then apply Framework lifecycle methods at the end of this process.- 覆盖:
buildView在类中UrlBasedViewResolver- 参数:
viewName- the name of the view to build- 返回:
- the View instance
- 抛出:
Exception- if the view couldn't be resolved- 另请参阅:
-