Package io.github.erdos.stencil.impl
Class CachingTemplateFactory
- java.lang.Object
-
- io.github.erdos.stencil.impl.CachingTemplateFactory
-
- All Implemented Interfaces:
TemplateFactory
public final class CachingTemplateFactory extends java.lang.Object implements TemplateFactory
Wraps a TemplateFactory instance and proxies calls only iff template file has not been changed since last call.
-
-
Constructor Summary
Constructors Constructor Description CachingTemplateFactory(TemplateFactory templateFactory)
Constructs a new wrapping instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreparedTemplate
prepareTemplateFile(java.io.File templateFile, PrepareOptions options)
Preprocesses a raw template file.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.erdos.stencil.TemplateFactory
prepareTemplateFile
-
-
-
-
Constructor Detail
-
CachingTemplateFactory
public CachingTemplateFactory(TemplateFactory templateFactory)
Constructs a new wrapping instance. Caches in memory.- Parameters:
templateFactory
- instance to wrap- Throws:
java.lang.IllegalArgumentException
- on null input.
-
-
Method Detail
-
prepareTemplateFile
public PreparedTemplate prepareTemplateFile(java.io.File templateFile, PrepareOptions options) throws java.io.IOException
Description copied from interface:TemplateFactory
Preprocesses a raw template file.- Specified by:
prepareTemplateFile
in interfaceTemplateFactory
- Parameters:
templateFile
- raw template file of known type.options
- template preparation options.- Returns:
- preprocessed template file
- Throws:
java.io.IOException
- on file system errorjava.io.FileNotFoundException
- when file does not exist
-
-