@Override public Object findTemplateSource(String name) throws IOException { return delegate.findTemplateSource(name); }
Object source = lastTemplateLoader.findTemplateSource(name); if (source != null) { return new MultiSource(source, lastTemplateLoader); Object source = templateLoader.findTemplateSource(name); if (source != null) { if (sticky) {
private Object findTemplateSource(String path) throws IOException { final Object result = templateLoader.findTemplateSource(path); if (LOG.isDebugEnabled()) { LOG.debug("TemplateLoader.findTemplateSource(" + StringUtil.jQuote(path) + "): " + (result == null ? "Not found" : "Found")); } return modifyForConfIcI(result); }
/** 判定模板是否存在。 */ public boolean exists(String templateName) { try { return configuration.getTemplateLoader().findTemplateSource(templateName) != null; } catch (IOException e) { return false; } }
/** 判定模板是否存在。 */ public boolean exists(String templateName) { try { return configuration.getTemplateLoader().findTemplateSource(templateName) != null; } catch (IOException e) { return false; } }
@Override public Object findTemplateSource(String name) throws IOException { return delegate.findTemplateSource(name); }
public Object findTemplateSource(String templateSource) throws IOException { Object source = loader1.findTemplateSource(templateSource); if (source != null) { map.put(source, loader1); return source; } source = loader2.findTemplateSource(templateSource); if (source != null) { map.put(source, loader2); } return source; }
/** 判定模板是否存在。 */ public boolean exists(String templateName) { try { return configuration.getTemplateLoader().findTemplateSource(templateName) != null; } catch (IOException e) { return false; } }
@Override public Object findTemplateSource(String name) throws IOException { for (TemplateLoader loader : loaders) { Object source = loader.findTemplateSource(name); if (source != null) { return new MultiSource(source, loader); } } return null; }
@Override public boolean exist(String template) throws IOException { return this.freemarker.getTemplateLoader().findTemplateSource(template) != null; } @Override
@Override public Object findTemplateSource( @Nonnull String name ) throws IOException { FmxRecord result = null; if( isFmx.test( name ) ) { Object resource = delegate.findTemplateSource( name ); if( resource != null ) { result = new FmxRecord( resource, null ); } } return result; }
@Override public Object findTemplateSource(String name) throws IOException { for (TemplateLoader loader : loaders) { final Object object = loader.findTemplateSource(name); if (object != null) return new Item(loader, object); } return null; }
@Override public Object findTemplateSource(String name) throws IOException { Object innerTS = innerLoader.findTemplateSource(name); log.debug("template source for '" + name + "' is '" + innerTS + "'"); if (innerTS == null) { return null; } else { return new DelimitingTemplateSource(name, innerTS); } }
@Override public Object findTemplateSource(String name) throws IOException { for (TemplateLoader loader : loaders) { Object source = loader.findTemplateSource(name); if (source != null) { return new MultiSource(source, loader); } } return null; }
@Override public Object findTemplateSource(String name) throws IOException { return freemarkerConfig.getTemplateLoader().findTemplateSource(name); }
@Override public Object findTemplateSource(String name) throws IOException { return getDelegate().findTemplateSource(name); }
public void process(String template, Object model, Writer out) { TemplateSource templateSource; try { templateSource = (TemplateSource) templateLoader.findTemplateSource(template); } catch (IOException ex) { throw new TemplateException(MSG_UNABLE_TO_READ_TEMPLATE, new Object[] { ex.getMessage() }, ex); } process(templateSource, model, out); }
private Object findTemplateSource(String path) throws IOException { final Object result = templateLoader.findTemplateSource(path); if (LOG.isDebugEnabled()) { LOG.debug("TemplateLoader.findTemplateSource(" + StringUtil.jQuote(path) + "): " + (result == null ? "Not found" : "Found")); } return modifyForConfIcI(result); }
private Object findTemplateSource(String path) throws IOException { final Object result = templateLoader.findTemplateSource(path); if (LOG.isDebugEnabled()) { LOG.debug("TemplateLoader.findTemplateSource(" + StringUtil.jQuote(path) + "): " + (result == null ? "Not found" : "Found")); } return modifyForConfIcI(result); }
@Test public void testTemplateLoader() throws Exception { TemplateLoader loader = getClassPathStore().getTemplateLoader(); Object templateSource = loader.findTemplateSource("folder2/template.ftl"); assertNotNull(templateSource); Reader reader = loader.getReader(templateSource, null); String text = FileCopyUtils.copyToString(reader); assertEquals("<html></html>", text); }