Examples of importTemplates()


Examples of org.stringtemplate.v4.STGroup.importTemplates()

    "%>\n";
    writeFile(dir, "g2.stg", g2);

    STGroup group1 = new STGroupFile(dir+"/g1.stg");
    STGroup group2 = new STGroupFile(dir+"/g2.stg");
    group2.importTemplates(group1); // define r in g2
    ST st = group2.getInstanceOf("a");
    String expected = "[foo]";
    String result = st.render();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.STGroup.importTemplates()

      "t() ::= <<\n" +
      "<d.a>\n" +
      ">>\n";
    STGroup r = new STGroupString(Root);
    STGroup s = new STGroupString(Sub);
    s.importTemplates(r);
    ST st = s.getInstanceOf("t"); // visible only if we can see inherited dicts
    String expected = "b";
    String result = st.render();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.STGroup.importTemplates()

//          System.out.println("##### TEMPLATE : " + f);
//          System.out.println(template.toString());
//          System.out.println("##### END TEMPLATE : " + f);
          STGroup group = new STGroupString("page", template.toString(), '$', '$');
          if (parent != null)
            group.importTemplates(parent);
          return group;
        } catch (Exception x) {
          log.warn("Caught", x);
        }
        return null;
View Full Code Here

Examples of org.stringtemplate.v4.STGroupFile.importTemplates()

    "%>\n";
    writeFile(dir, "g2.stg", g2);

    STGroup group1 = new STGroupFile(dir+"/g1.stg");
    STGroup group2 = new STGroupFile(dir+"/g2.stg");
    group2.importTemplates(group1); // define r in g2
    ST st = group2.getInstanceOf("a");
    String expected = "[foo]";
    String result = st.render();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.STGroupString.importTemplates()

      "t() ::= <<\n" +
      "<d.a>\n" +
      ">>\n";
    STGroup r = new STGroupString(Root);
    STGroup s = new STGroupString(Sub);
    s.importTemplates(r);
    ST st = s.getInstanceOf("t"); // visible only if we can see inherited dicts
    String expected = "b";
    String result = st.render();
    assertEquals(expected, result);
  }
View Full Code Here

Examples of org.stringtemplate.v4.STGroupString.importTemplates()

//          System.out.println("##### TEMPLATE : " + f);
//          System.out.println(template.toString());
//          System.out.println("##### END TEMPLATE : " + f);
          STGroup group = new STGroupString("page", template.toString(), '$', '$');
          if (parent != null)
            group.importTemplates(parent);
          return group;
        } catch (Exception x) {
          log.warn("Caught", x);
        }
        return null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.