/** * <p> * Returns the template repository. Normally there is no reason why users * would want to obtain or use this object directly (and it is not recommended * behaviour). * </p> * * @return the template repository */ public TemplateRepository getTemplateRepository() { if (!isInitialized()) { throw new NotInitializedException("Template Engine has not been initialized"); } return this.templateRepository; }
/** * <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); }
if (!isInitialized()) {
final IFragmentSpec fragmentSpec, final Writer writer) { if (!isInitialized()) { initialize();
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); }