Search in sources :

Example 1 with FileTemplateSource

use of core.framework.impl.template.source.FileTemplateSource in project core-ng-project by neowu.

the class TemplateManager method load.

private Map<String, HTMLTemplate> load(String templatePath, Class<?> modelClass) {
    HTMLTemplateBuilder builder = new HTMLTemplateBuilder(new FileTemplateSource(webDirectory.root(), templatePath), modelClass);
    builder.cdn = cdnManager;
    Map<String, HTMLTemplate> templates = Maps.newHashMap();
    for (String language : message.languages) {
        builder.message = key -> message.get(key, language);
        HTMLTemplate htmlTemplate = builder.build();
        templates.put(language, htmlTemplate);
    }
    return templates;
}
Also used : FileTemplateSource(core.framework.impl.template.source.FileTemplateSource) HTMLTemplateBuilder(core.framework.impl.template.HTMLTemplateBuilder) HTMLTemplate(core.framework.impl.template.HTMLTemplate)

Aggregations

HTMLTemplate (core.framework.impl.template.HTMLTemplate)1 HTMLTemplateBuilder (core.framework.impl.template.HTMLTemplateBuilder)1 FileTemplateSource (core.framework.impl.template.source.FileTemplateSource)1