Package io.github.erdos.stencil.impl
Class DirWatcherTemplateFactory
java.lang.Object
io.github.erdos.stencil.impl.DirWatcherTemplateFactory
- All Implemented Interfaces:
- TemplateFactory
Watches file system and automatically loads template files on file changes.
- 
Constructor SummaryConstructorsConstructorDescriptionDirWatcherTemplateFactory(File templatesDirectory, TemplateFactory factory) Default ctor.
- 
Method SummaryModifier and TypeMethodDescriptionprepareTemplateFile(File inputTemplateFile, PrepareOptions options) Preprocesses a raw template file.voidstart()Starts directory watcher and tries to load all files.voidstop()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.erdos.stencil.TemplateFactoryprepareTemplateFile
- 
Constructor Details- 
DirWatcherTemplateFactoryDefault ctor.- Parameters:
- templatesDirectory- not null absolute path directory
- factory- wrapped factory
 
 
- 
- 
Method Details- 
getTemplatesDirectory
- 
startStarts directory watcher and tries to load all files.- Throws:
- IOException- on file system errors
- IllegalStateException- if already started
 
- 
stoppublic void stop()
- 
prepareTemplateFileDescription copied from interface:TemplateFactoryPreprocesses a raw template file.- Specified by:
- prepareTemplateFilein interface- TemplateFactory
- Parameters:
- inputTemplateFile- raw template file of known type.
- options- template preparation options.
- Returns:
- preprocessed template file
 
 
-