public class MiniTemplatorCache extends Object
Example of how to use the template cache:
private static MiniTemplatorCache miniTemplatorCache = new MiniTemplatorCache(); public static MiniTemplator getTemplate(String templateFileName, Setflags) throws Exception { MiniTemplator.TemplateSpecification templateSpec = new MiniTemplator.TemplateSpecification(); templateSpec.templateFileName = templateFileName; templateSpec.conditionFlags = flags; return miniTemplatorCache.get(templateSpec); };
Home page: www.source-code.biz/MiniTemplator
Author: Christian d'Heureuse, Inventec Informatik AG, Zurich, Switzerland
Multi-licensed: EPL / LGPL.
| 构造器和说明 |
|---|
MiniTemplatorCache()
Creates a new MiniTemplatorCache object.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
Clears the cache.
|
MiniTemplator |
get(MiniTemplator.TemplateSpecification templateSpec)
Returns a cloned MiniTemplator object from the cache.
|
public MiniTemplator get(MiniTemplator.TemplateSpecification templateSpec) throws IOException, MiniTemplator.TemplateSyntaxException
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.templateSpec - the template specification.IOExceptionMiniTemplator.TemplateSyntaxExceptionpublic void clear()
Copyright © 2019 Baidu, Inc.. All rights reserved.