Class 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 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 interface TemplateFactory
        Parameters:
        templateFile - raw template file of known type.
        options - template preparation options.
        Returns:
        preprocessed template file
        Throws:
        java.io.IOException - on file system error
        java.io.FileNotFoundException - when file does not exist