public static Template compileTemplateWithSingleBrackets(String templateWithSingleBrackets) { String templateWithDoubleBrackets = templateWithSingleBrackets.replaceAll("\\{", "{{").replaceAll("}", "}}"); return compileTemplate(templateWithDoubleBrackets); }
@Override public Template load(String template) throws Exception { return Mustaches.compileTemplateWithSingleBrackets(template); } });
@Override public void generate(Path path, Object scope) throws IOException { Mustaches.execute(template, scope, resolvePath(path, this.path, scope)); } }
public static Template compileTemplate(String template) { return createCompiler().compile(template); }
@Override public void generate(Path path, Object scope) throws IOException { Mustaches.execute(template, scope, resolvePath(path, this.path, scope)); } }
public static Template compileTemplate(String template) { return createCompiler().compile(template); }
public ErrorAnnotationProcessor() { errorDescriptorTpl = Mustaches.compile(ErrorAnnotationProcessor.class, "ErrorDescriptor.mustache"); }
protected Path resolvePath(Path path, String relative, Object scope) { return path.resolve(Mustaches.execute( Mustache.compiler().escapeHTML(false).compile(relative), scope)); }
public static Template compile(String name, CharSource charSource) { try (Reader reader = charSource.openBufferedStream()) { return createCompiler().compile(reader); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public Template load(String template) throws Exception { return Mustaches.compileTemplateWithSingleBrackets(template); } });
public static Template compileTemplateWithSingleBrackets(String templateWithSingleBrackets) { String templateWithDoubleBrackets = templateWithSingleBrackets.replaceAll("\\{", "{{").replaceAll("}", "}}"); return compileTemplate(templateWithDoubleBrackets); }
public RestxAnnotationProcessor() { routerTpl = Mustaches.compile(RestxAnnotationProcessor.class, "RestxRouter.mustache"); }
protected Path resolvePath(Path path, String relative, Object scope) { return path.resolve(Mustaches.execute( Mustache.compiler().escapeHTML(false).compile(relative), scope)); }
public static Template compile(String name, CharSource charSource) { try (Reader reader = charSource.openBufferedStream()) { return createCompiler().compile(reader); } catch (IOException e) { throw new RuntimeException(e); } }
public FactoryAnnotationProcessor() { componentMachineTpl = compile(FactoryAnnotationProcessor.class, "ComponentMachine.mustache"); conditionalMachineTpl = compile(FactoryAnnotationProcessor.class, "ConditionalMachine.mustache"); moduleMachineTpl = compile(FactoryAnnotationProcessor.class, "ModuleMachine.mustache"); machinesDeclaration = new ServicesDeclaration("restx.factory.FactoryMachine"); }
private static TemplateArchetypeEntry buildTemplate(String basePath, String tpl) { return new TemplateArchetypeEntry(Mustaches.compile(basePath + tpl), tpl .replaceAll("^_([^/]+$)", "$1") .replaceAll("/_([^/]+$)", "/$1") .replaceAll("\\$([^_]+)\\$", "\\{\\{$1\\}\\}")); }
private static TemplateArchetypeEntry buildTemplate(String tplPath, CharSource charSource) { return new TemplateArchetypeEntry(Mustaches.compile(tplPath, charSource), tplPath .replaceAll("^_([^/]+$)", "$1") .replaceAll("/_([^/]+$)", "/$1") .replaceAll("\\$([^_]+)\\$", "\\{\\{$1\\}\\}")); }