Package io.github.erdos.stencil.impl
Class CachingTemplateFactory
java.lang.Object
io.github.erdos.stencil.impl.CachingTemplateFactory
- All Implemented Interfaces:
TemplateFactory
Wraps a TemplateFactory instance and proxies calls only iff template file has not been changed since last call.
-
Constructor Summary
ConstructorsConstructorDescriptionCachingTemplateFactory
(TemplateFactory templateFactory) Constructs a new wrapping instance. -
Method Summary
Modifier and TypeMethodDescriptionprepareTemplateFile
(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 Details
-
CachingTemplateFactory
Constructs a new wrapping instance. Caches in memory.- Parameters:
templateFactory
- instance to wrap- Throws:
IllegalArgumentException
- on null input.
-
-
Method Details
-
prepareTemplateFile
public PreparedTemplate prepareTemplateFile(File templateFile, PrepareOptions options) throws 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:
IOException
- on file system errorFileNotFoundException
- when file does not exist
-