Package freemarker.ext.util
Class ModelCache
- java.lang.Object
-
- freemarker.ext.util.ModelCache
-
- Direct Known Subclasses:
BeansModelCache
public abstract class ModelCache extends java.lang.ObjectInternally used by various wrapper implementations to implement model caching.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedModelCache()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclearCache()protected abstract TemplateModelcreate(java.lang.Object object)TemplateModelgetInstance(java.lang.Object object)booleangetUseCache()protected abstract booleanisCacheable(java.lang.Object object)voidsetUseCache(boolean useCache)Sets whether this wrapper caches model instances.
-
-
-
Method Detail
-
setUseCache
public void setUseCache(boolean useCache)
Sets whether this wrapper caches model instances. Default is false. When set to true, callinggetInstance(Object)multiple times for the same object will return the same model.
-
getUseCache
public boolean getUseCache()
- Since:
- 2.3.21
-
getInstance
public TemplateModel getInstance(java.lang.Object object)
-
create
protected abstract TemplateModel create(java.lang.Object object)
-
isCacheable
protected abstract boolean isCacheable(java.lang.Object object)
-
clearCache
public void clearCache()
-
-