public Mustache compile(Reader reader, String file) { return compile(reader, file, DEFAULT_SM, DEFAULT_EM); }
public Mustache compile(Reader reader, String file, String sm, String em) { return compile(reader, null, new AtomicInteger(0), file, sm, em, true); }
public Mustache compile(Reader reader, String file, String sm, String em, boolean startOfLine) { return compile(reader, null, new AtomicInteger(0), file, sm, em, startOfLine); }
public Mustache compile(Reader reader, String file, String sm, String em) { Mustache compile = mc.compile(reader, file, sm, em); compile.init(); partialCache.remove(); return compile; }
public Mustache compile(String file) { Reader reader = mf.getReader(file); if (reader == null) { throw new MustacheNotFoundException(file); } return compile(reader, file); }
/** * In order to handle recursion, we need a temporary thread local cache during compilation * that is ultimately thrown away after the top level partial is complete. * * @param s the name of the partial to compile * @return the compiled partial */ public Mustache compilePartial(String s) { final Map<String, Mustache> cache = partialCache.get(); final Mustache cached = cache.get(s); if (cached != null) { // Our implementation supports this but I // don't think it makes sense in the interface if (cached instanceof DefaultMustache) { ((DefaultMustache)cached).setRecursive(); } return cached; } try { final Mustache mustache = mc.compile(s); cache.put(s, mustache); mustache.init(); return mustache; } finally { cache.remove(s); } }
protected Function<FragmentKey, Mustache> getFragmentCacheFunction() { return (fragmentKey) -> { StringReader reader = new StringReader(fragmentKey.templateText); TemplateContext tc = fragmentKey.tc; return mc.compile(reader, tc.file(), tc.startChars(), tc.endChars(), tc.startOfLine()); }; }
@Override protected Function<String, Mustache> getMustacheCacheFunction() { return (template) -> { Mustache compile = mp.compile(template); compile.init(); return compile; }; } };
startOfLine = startOfLine & onlywhitespace; int line = currentLine.get(); final Mustache mustache = compile(br, variable, currentLine, file, sm, em, startOfLine); int lines = currentLine.get() - line; if (!onlywhitespace || lines == 0) {
public Mustache compile(Reader reader, String file) { return compile(reader, file, DEFAULT_SM, DEFAULT_EM); }
public Mustache compile(Reader reader, String file) { return compile(reader, file, DEFAULT_SM, DEFAULT_EM); }
public Mustache compile(Reader reader, String file, String sm, String em) { return compile(reader, null, new AtomicInteger(0), file, sm, em, true); }
public Mustache compile(Reader reader, String file, String sm, String em, boolean startOfLine) { return compile(reader, null, new AtomicInteger(0), file, sm, em, startOfLine); }
public Mustache compile(Reader reader, String file, String sm, String em) { Mustache compile = mc.compile(reader, file, sm, em); compile.init(); partialCache.remove(); return compile; }
public Mustache compile(Reader reader, String file, String sm, String em) { Mustache compile = mc.compile(reader, file, sm, em); compile.init(); partialCache.remove(); return compile; }
public Mustache compile(String file) { Reader reader = mf.getReader(file); if (reader == null) { throw new MustacheNotFoundException(file); } return compile(reader, file); }
public Mustache compile(String file) { Reader reader = mf.getReader(file); if (reader == null) { throw new MustacheNotFoundException(file); } return compile(reader, file); }
protected Function<FragmentKey, Mustache> getFragmentCacheFunction() { return (fragmentKey) -> { StringReader reader = new StringReader(fragmentKey.templateText); TemplateContext tc = fragmentKey.tc; return mc.compile(reader, tc.file(), tc.startChars(), tc.endChars(), tc.startOfLine()); }; }
protected Function<FragmentKey, Mustache> getFragmentCacheFunction() { return (fragmentKey) -> { StringReader reader = new StringReader(fragmentKey.templateText); TemplateContext tc = fragmentKey.tc; return mc.compile(reader, tc.file(), tc.startChars(), tc.endChars(), tc.startOfLine()); }; }
public Mustache compile(String name) { if (config.cache_templates) { return super.compile(name); } try { Mustache mustache = mc.compile(name); mustache.init(); return mustache; } catch (UncheckedExecutionException e) { throw handle(e); } }