freemarker.ext.util
Class ModelCache

java.lang.Object
  extended by freemarker.ext.util.ModelCache

public 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
ModelCache(ObjectWrapper wrapper)
           
 
Method Summary
 void clearCache()
           
 TemplateModel getInstance(java.lang.Object object, ModelFactory factory)
           
 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

public ModelCache(ObjectWrapper wrapper)
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, ModelFactory) multiple times for the same object will return the same model.


getInstance

public TemplateModel getInstance(java.lang.Object object,
                                 ModelFactory factory)

clearCache

public void clearCache()