public TemplateFactory newTemplateFactory(File file, String encoding, TemplateModifier modifier, ExpressionLanguage expressionLanguage) throws TemplateLoadingException { TemplateDocument document = parseTemplate(file, encoding, expressionLanguage); if (modifier != null) { modifier.modifyTemplate(document); } try { if (document.getIncludes() != null) { return new FileTemplateFactory(this, document.normalize(), file, encoding, modifier, getFiles(document.getIncludes()), changeDetectionInterval); } return new FileTemplateFactory(this, document.normalize(), file, encoding, modifier, null, changeDetectionInterval); } catch (BehaviorInstantiationException e) { throw new TemplateLoadingException(e); } }