@Test public void load() throws Exception { TemplateSetLoader loader = new FileTemplateSetLoader(tempPath.toFile()); TemplateSet templateSet = loader.load(); assertEquals(1, templateSet.getVariables().size()); assertEquals("name", templateSet.getVariables().get(0).getName()); }
@Override public TemplateSet load() throws IOException { Metadata metadata = loadMetadata(); Map<String, Template> templates = new HashMap<>(); for (String file : metadata.getTemplates()) { templates.put(file, loadTemplate(file)); } try { templates.put(FILE_MAPPING_TEMPLATE_FILENAME, loadTemplate(FILE_MAPPING_TEMPLATE_FILENAME)); } catch (IOException ignored) { } return new TemplateSet(templates, metadata.getVariables()); }
FileTemplateSetLoader extends TemplateSetLoader { @Override public TemplateSet load() throws IOException { Metadata metadata = loadMetadata(); Map<String, Template> templates = new HashMap<>(); for (String file : metadata.getTemplates()) { templates.put(file, loadTemplate(file)); } try { templates.put(FILE_MAPPING_TEMPLATE_FILENAME, loadTemplate(FILE_MAPPING_TEMPLATE_FILENAME)); } catch (IOException ignored) { } return new TemplateSet(templates, metadata.getVariables()); } }
FileTemplateSetLoader extends TemplateSetLoader { @Override public TemplateSet load() throws IOException { Metadata metadata = loadMetadata(); Map<String, Template> templates = new HashMap<>(); for (String file : metadata.getTemplates()) { templates.put(file, loadTemplate(file)); } try { templates.put(FILE_MAPPING_TEMPLATE_FILENAME, loadTemplate(FILE_MAPPING_TEMPLATE_FILENAME)); } catch (IOException ignored) { } return new TemplateSet(templates, metadata.getVariables()); } FileTemplateSetLoader(File root); }
FileTemplateSetLoader extends TemplateSetLoader { @Override public TemplateSet load() throws IOException { Metadata metadata = loadMetadata(); Map<String, Template> templates = new HashMap<>(); for (String file : metadata.getTemplates()) { templates.put(file, loadTemplate(file)); } try { templates.put(FILE_MAPPING_TEMPLATE_FILENAME, loadTemplate(FILE_MAPPING_TEMPLATE_FILENAME)); } catch (IOException ignored) { } return new TemplateSet(templates, metadata.getVariables()); } FileTemplateSetLoader(File root); @Override TemplateSet load(); File getRoot(); }
FileTemplateSetLoader extends TemplateSetLoader { @Override public TemplateSet load() throws IOException { Metadata metadata = loadMetadata(); Map<String, Template> templates = new HashMap<>(); for (String file : metadata.getTemplates()) { templates.put(file, loadTemplate(file)); } try { templates.put(FILE_MAPPING_TEMPLATE_FILENAME, loadTemplate(FILE_MAPPING_TEMPLATE_FILENAME)); } catch (IOException ignored) { } return new TemplateSet(templates, metadata.getVariables()); } FileTemplateSetLoader(File root); @Override TemplateSet load(); File getRoot();  }