类 ProxyTemplateLoader
java.lang.Object
net.entframework.kernel.db.generator.plugin.web.freemarker.ProxyTemplateLoader
- 所有已实现的接口:
freemarker.cache.StatefulTemplateLoader,freemarker.cache.TemplateLoader
A
TemplateLoader that uses a set of other loaders to load the templates. On
every request, loaders are queried in the order of their appearance in the array of
loaders provided to the constructor. However, by default, if a request for some
template name was already satisfied in the past by one of the loaders, that loader is
queried first (stickiness). This behavior can be disabled with
setSticky(boolean), then the loaders are always queried in the order of their
appearance in the array.
This class is thread-safe.
-
构造器概要
构造器构造器说明ProxyTemplateLoader(freemarker.cache.TemplateLoader[] templateLoaders) Creates a new instance that will use the specified template loaders. -
方法概要
修饰符和类型方法说明voidcloseTemplateSource(Object templateSource) findTemplateSource(String name) longgetLastModified(Object templateSource) freemarker.cache.TemplateLoadergetTemplateLoader(int index) Returns theTemplateLoaderat the given index.intReturns the number ofTemplateLoader-s directly inside thisTemplateLoader.booleanisSticky()Getter pair ofsetSticky(boolean).voidClears the sickiness memory, also resets the state of all enclosedStatefulTemplateLoader-s.voidsetSticky(boolean sticky) Sets if for a name that was already loaded earlier the sameTemplateLoaderwill be tried first, or we always try theTemplateLoader-s strictly in the order as it was specified in the constructor.toString()Show class name and some details that are useful in template-not-found errors.
-
构造器详细资料
-
ProxyTemplateLoader
public ProxyTemplateLoader(freemarker.cache.TemplateLoader[] templateLoaders) Creates a new instance that will use the specified template loaders.- 参数:
templateLoaders- the template loaders that are used to load templates, in the order as they will be searched (except where stickiness says otherwise).
-
-
方法详细资料
-
findTemplateSource
- 指定者:
findTemplateSource在接口中freemarker.cache.TemplateLoader- 抛出:
IOException
-
getLastModified
- 指定者:
getLastModified在接口中freemarker.cache.TemplateLoader
-
getReader
- 指定者:
getReader在接口中freemarker.cache.TemplateLoader- 抛出:
IOException
-
closeTemplateSource
- 指定者:
closeTemplateSource在接口中freemarker.cache.TemplateLoader- 抛出:
IOException
-
resetState
public void resetState()Clears the sickiness memory, also resets the state of all enclosedStatefulTemplateLoader-s.- 指定者:
resetState在接口中freemarker.cache.StatefulTemplateLoader
-
toString
Show class name and some details that are useful in template-not-found errors. -
getTemplateLoaderCount
public int getTemplateLoaderCount()Returns the number ofTemplateLoader-s directly inside thisTemplateLoader.- 从以下版本开始:
- 2.3.23
-
getTemplateLoader
public freemarker.cache.TemplateLoader getTemplateLoader(int index) Returns theTemplateLoaderat the given index.- 参数:
index- Must be belowgetTemplateLoaderCount().
-
isSticky
public boolean isSticky()Getter pair ofsetSticky(boolean).- 从以下版本开始:
- 2.3.24
-
setSticky
public void setSticky(boolean sticky) Sets if for a name that was already loaded earlier the sameTemplateLoaderwill be tried first, or we always try theTemplateLoader-s strictly in the order as it was specified in the constructor. The default istrue.- 从以下版本开始:
- 2.3.24
-