freemarker.ext.util
Class ModelCache

java.lang.Object
  extended by freemarker.ext.util.ModelCache
Direct Known Subclasses:
BeansModelCache

public abstract class ModelCache
extends java.lang.Object

Internally used by various wrapper implementations to implement model caching.

Version:
$Id: ModelCache.java,v 1.9 2003/01/12 23:40:15 revusky Exp $
Author:
Attila Szegedi

Constructor Summary
protected ModelCache()
           
 
Method Summary
 void clearCache()
           
protected abstract  TemplateModel create(java.lang.Object object)
           
 TemplateModel getInstance(java.lang.Object object)
           
protected abstract  boolean isCacheable(java.lang.Object object)
           
 void setUseCache(boolean useCache)
          Sets whether this wrapper caches model instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelCache

protected ModelCache()
Method Detail

setUseCache

public void setUseCache(boolean useCache)
Sets whether this wrapper caches model instances. Default is false. When set to true, calling getInstance(Object) multiple times for the same object will return the same model.


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()