this.loader = loader;
}
@Override
public TemplateRegistry get() {
TemplateRegistry registry = new SimpleTemplateRegistry();
for (RegisteredTemplate template : templates) {
String templateName = template.getName();
Class<?> pageClass = template.getPageClass();
Template loadedTemplate = loader.load(pageClass);
CompiledTemplate compiledTemplate;
compiledTemplate = TemplateCompiler.compileTemplate(loadedTemplate.getText());
registry.addNamedTemplate(templateName, compiledTemplate);
}
return registry;
}