Package net.sf.lapg.templates.api.impl

Examples of net.sf.lapg.templates.api.impl.StringTemplateLoader


  }

  private void generateOutput(Map<String, Object> map, String grammarTemplates, final INotifier notifier) {

    List<IBundleLoader> loaders = new ArrayList<IBundleLoader>();
    loaders.add(new StringTemplateLoader("input", grammarTemplates)); // TODO create with initial location
    for (String path : options.getIncludeFolders()) {
      IBundleLoader tl = createTemplateLoader(path);
      if (tl != null) {
        loaders.add(tl);
      }
View Full Code Here


  public void testOverrides() {
    Hashtable<String,String[]> h = new Hashtable<String,String[]>();
    h.put("list", new String[] { "a", "b" });
    TemplatesFacade env = new TestTemplatesFacade(new DefaultNavigationFactory(),
        new StringTemplateLoader("inline", "${template overrides.my2}go next my2(${call base})\n\n${end}"),
        new ClassTemplateLoader(getClass().getClassLoader(), TEMPLATES_LOCATION, TEMPLATES_CHARSET));
    EvaluationContext context = new EvaluationContext(h);
    context.setVariable("util", new DefaultStaticMethods());

    // test 1
View Full Code Here

    Assert.assertEquals("go next my2(my2\n)\n\n", q);
  }

  public void testOverrides2() {
    TestTemplatesFacade env = new TestTemplatesFacade(new DefaultNavigationFactory(),
        new StringTemplateLoader("inline", "${template overrides.my1(aa)}go next my1\n\n${end}"),
        new ClassTemplateLoader(getClass().getClassLoader(), TEMPLATES_LOCATION, TEMPLATES_CHARSET));
    EvaluationContext context = new EvaluationContext(null);

    // test 1
    env.addErrors("Template `my1(aa)` is not compatible with base template `my1`");
View Full Code Here

TOP

Related Classes of net.sf.lapg.templates.api.impl.StringTemplateLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.