public IEngineConfiguration getConfiguration() { if (!this.initialized) { initialize(); } return this.configuration; }
/** * <p> * Completely clears the Template Cache. * </p> * <p> * If this method is called before the TemplateEngine has been initialized, * it causes its initialization. * </p> */ public void clearTemplateCache() { if (!this.initialized) { initialize(); } this.configuration.getTemplateManager().clearCaches(); }
/** * <p> * Clears the entry in the Template Cache for the specified * template, if it is currently cached. * </p> * <p> * If this method is called before the TemplateEngine has been initialized, * it causes its initialization. * </p> * * @param templateName the name of the template to be cleared from cache. */ public void clearTemplateCacheFor(final String templateName) { Validate.notNull(templateName, "Template name cannot be null"); if (!this.initialized) { initialize(); } this.configuration.getTemplateManager().clearCachesFor(templateName); }
public final IThrottledTemplateProcessor processThrottled(final TemplateSpec templateSpec, final IContext context) { initialize();
public final void process(final TemplateSpec templateSpec, final IContext context, final Writer writer) { initialize();
public Thymeleaf(TemplateConfig config, boolean ignoreConfigPrefixAndSuffix) { this.config = config; this.ignoreConfigPrefixAndSuffix = ignoreConfigPrefixAndSuffix; templateEngine.setTemplateResolvers(getTemplateResolvers()); if (config.auto_initialize_thymeleaf) { templateEngine.initialize(); } }
/** * <p> * Completely clears the Template Cache. * </p> * <p> * If this method is called before the TemplateEngine has been initialized, * it causes its initialization. * </p> */ public void clearTemplateCache() { if (!isInitialized()) { initialize(); } this.templateRepository.clearTemplateCache(); }
/** * <p> * Clears the entry in the Template Cache for the specified * template, if it is currently cached. * </p> * <p> * If this method is called before the TemplateEngine has been initialized, * it causes its initialization. * </p> * * @param templateName the name of the template to be cleared from cache. */ public void clearTemplateCacheFor(final String templateName) { Validate.notNull(templateName, "Template name cannot be null"); if (!isInitialized()) { initialize(); } this.templateRepository.clearTemplateCacheFor(templateName); }
private static TilesFragment computeTemplateSelector(final TemplateEngine templateEngine, final IProcessingContext processingContext, final String templateSelector) { if (!templateEngine.isInitialized()) { templateEngine.initialize(); } if (!isStandardDialectPresent(templateEngine)) { return computeNonStandardFragment(templateEngine, templateSelector); } final Configuration configuration = templateEngine.getConfiguration(); final String tilesDialectPrefix = getTilesDialectPrefix(templateEngine); final StandardFragment standardFragment = StandardFragmentProcessor.computeStandardFragmentSpec(configuration, processingContext, templateSelector, tilesDialectPrefix, TilesFragmentAttrProcessor.ATTR_NAME); return new TilesFragment(standardFragment); }
private static TilesFragment computeTemplateSelector(final TemplateEngine templateEngine, final IProcessingContext processingContext, final String templateSelector) { if (!templateEngine.isInitialized()) { templateEngine.initialize(); } if (!isStandardDialectPresent(templateEngine)) { return computeNonStandardFragment(templateEngine, templateSelector); } final Configuration configuration = templateEngine.getConfiguration(); final String tilesDialectPrefix = getTilesDialectPrefix(templateEngine); final StandardFragment standardFragment = StandardFragmentProcessor.computeStandardFragmentSpec(configuration, processingContext, templateSelector, tilesDialectPrefix, TilesFragmentAttrProcessor.ATTR_NAME); return new TilesFragment(standardFragment); }
new ClassLoaderResourceResolver(), "UTF-8", templateMode, new AlwaysValidTemplateResolutionValidity()); templateEngine.initialize();