biz.source_code.miniTemplator
Class MiniTemplatorCache

java.lang.Object
  extended by biz.source_code.miniTemplator.MiniTemplatorCache

public class MiniTemplatorCache
extends Object

A cache manager for MiniTemplator objects. This class is used to cache MiniTemplator objects in memory, so that each template file is only read and parsed once.

Home page: www.source-code.biz/MiniTemplator
Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
Multi-licensed: EPL/LGPL.


Constructor Summary
MiniTemplatorCache()
          Creates a new MiniTemplatorCache object.
 
Method Summary
 void clear()
          Clears the cache.
 MiniTemplator get(MiniTemplator.TemplateSpecification templateSpec)
          Returns a cloned MiniTemplator object from the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiniTemplatorCache

public MiniTemplatorCache()
Creates a new MiniTemplatorCache object.

Method Detail

get

public MiniTemplator get(MiniTemplator.TemplateSpecification templateSpec)
                  throws IOException,
                         MiniTemplator.TemplateSyntaxException
Returns a cloned MiniTemplator object from the cache. If there is not yet a MiniTemplator object with the specified templateFileName in the cache, a new MiniTemplator object is created and stored in the cache. Then the cached MiniTemplator object is cloned and the clone object is returned.

Parameters:
templateSpec - the template specification.
Returns:
a cloned and reset MiniTemplator object.
Throws:
IOException
MiniTemplator.TemplateSyntaxException

clear

public void clear()
Clears the cache.



Copyright © 2012. All Rights Reserved.