@Test public void testLoad() { TemplateFactory factory = loader.newTemplateFactory("cambridge/basic.html", Expressions.cambridgeExpressionLanguage); assertNotNull(factory); Template t = factory.createTemplate(); assertEquals("<div class=\"\">xxx</div>", t.asString()); }
public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException { InputStream in = classLoader.getResourceAsStream(template); TemplateDocument doc = parseTemplate(in, expressionLanguage); try { FragmentList fragments = doc.normalize(); return new ImmutableTemplateFactory(this, fragments); } catch (BehaviorInstantiationException e) { throw new TemplateLoadingException(e); } }
ClassPathTemplateLoader extends AbstractTemplateLoader { public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException { InputStream in = classLoader.getResourceAsStream(template); TemplateDocument doc = parseTemplate(in, expressionLanguage); try { FragmentList fragments = doc.normalize(); return new ImmutableTemplateFactory(this, fragments); } catch (BehaviorInstantiationException e) { throw new TemplateLoadingException(e); } } }
ClassPathTemplateLoader extends AbstractTemplateLoader { public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException { InputStream in = classLoader.getResourceAsStream(template); TemplateDocument doc = parseTemplate(in, expressionLanguage); try { FragmentList fragments = doc.normalize(); return new ImmutableTemplateFactory(this, fragments); } catch (BehaviorInstantiationException e) { throw new TemplateLoadingException(e); } } ClassPathTemplateLoader(ClassLoader classLoader);  ClassPathTemplateLoader(Class<?> c);  ClassPathTemplateLoader(); }
ClassPathTemplateLoader extends AbstractTemplateLoader { public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException { InputStream in = classLoader.getResourceAsStream(template); TemplateDocument doc = parseTemplate(in, expressionLanguage); try { FragmentList fragments = doc.normalize(); return new ImmutableTemplateFactory(this, fragments); } catch (BehaviorInstantiationException e) { throw new TemplateLoadingException(e); } } ClassPathTemplateLoader(ClassLoader classLoader);  ClassPathTemplateLoader(Class<?> c);  ClassPathTemplateLoader(); TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage); TemplateFactory newTemplateFactory(String template, String encoding, ExpressionLanguage expressionLanguage); TemplateFactory newTemplateFactory(String template, TemplateModifier modifier, ExpressionLanguage expressionLanguage); TemplateFactory newTemplateFactory(String template, String encoding, TemplateModifier modifier, ExpressionLanguage expressionLanguage); TemplateDocument parseTemplate(String templatePath, ExpressionLanguage expressionLanguage); TemplateDocument parseTemplate(String templatePath, String encoding, ExpressionLanguage expressionLanguage); }
ClassPathTemplateLoader extends AbstractTemplateLoader { public TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage) throws TemplateLoadingException { InputStream in = classLoader.getResourceAsStream(template); TemplateDocument doc = parseTemplate(in, expressionLanguage); try { FragmentList fragments = doc.normalize(); return new ImmutableTemplateFactory(this, fragments); } catch (BehaviorInstantiationException e) { throw new TemplateLoadingException(e); } } ClassPathTemplateLoader(ClassLoader classLoader);  ClassPathTemplateLoader(Class<?> c);  ClassPathTemplateLoader(); TemplateFactory newTemplateFactory(String template, ExpressionLanguage expressionLanguage); TemplateFactory newTemplateFactory(String template, String encoding, ExpressionLanguage expressionLanguage); TemplateFactory newTemplateFactory(String template, TemplateModifier modifier, ExpressionLanguage expressionLanguage); TemplateFactory newTemplateFactory(String template, String encoding, TemplateModifier modifier, ExpressionLanguage expressionLanguage); TemplateDocument parseTemplate(String templatePath, ExpressionLanguage expressionLanguage); TemplateDocument parseTemplate(String templatePath, String encoding, ExpressionLanguage expressionLanguage);  }