Package com.google.template.soy.tofu

Examples of com.google.template.soy.tofu.SoyTofu.newRenderer()


        .setData(new SoyMapData(DEMO_FOR.NUM_LINES, 3))
        .setMsgBundle(msgBundle)
        .render());

    writeExampleHeader("demoCallWithoutParam");
    System.out.println(tofu.newRenderer(DEMO_CALL_WITHOUT_PARAM)
        .setData(new SoyMapData(
                     DEMO_CALL_WITHOUT_PARAM.NAME, "Neo",
                     DEMO_CALL_WITHOUT_PARAM.TRIP_INFO,
                         new SoyMapData("name", "Neo", "destination", "The Matrix")))
        .setMsgBundle(msgBundle)
View Full Code Here


                         new SoyMapData("name", "Neo", "destination", "The Matrix")))
        .setMsgBundle(msgBundle)
        .render());

    writeExampleHeader("demoCallWithParam");
    System.out.println(tofu.newRenderer(DEMO_CALL_WITH_PARAM)
        .setData(ImmutableMap.of(
                 DEMO_CALL_WITH_PARAM.NAME, "Oz",
                 DEMO_CALL_WITH_PARAM.COMPANION_NAME, "Pip",
                 DEMO_CALL_WITH_PARAM.DESTINATIONS,
                 ImmutableList.of("Gillikin Country", "Munchkin Country",
View Full Code Here

                                  "Quadling Country", "Winkie Country")))
        .setMsgBundle(msgBundle)
        .render());

    writeExampleHeader("demoCallWithParamBlock");
    System.out.println(tofu.newRenderer(DEMO_CALL_WITH_PARAM_BLOCK)
        .setData(new SoyMapData(DEMO_CALL_WITH_PARAM_BLOCK.NAME, "Quo"))
        .setMsgBundle(msgBundle)
        .render());

    writeExampleHeader("demoExpressions");
View Full Code Here

    SoyListData students = new SoyListData();
    students.add(new SoyMapData("name", "Rob", "major", "Physics", "year", 1999));
    students.add(new SoyMapData("name", "Sha", "major", "Finance", "year", 1980));
    students.add(new SoyMapData("name", "Tim", "major", "Engineering", "year", 2005));
    students.add(new SoyMapData("name", "Uma", "major", "Biology", "year", 1972));
    System.out.println(tofu.newRenderer(DEMO_EXPRESSIONS)
        .setData(new SoyMapData(DEMO_EXPRESSIONS.STUDENTS, students,
                                DEMO_EXPRESSIONS.CURRENT_YEAR, 2008))
        .setMsgBundle(msgBundle)
        .render());
View Full Code Here

                                DEMO_EXPRESSIONS.CURRENT_YEAR, 2008))
        .setMsgBundle(msgBundle)
        .render());

    writeExampleHeader("demoDoubleBraces");
    System.out.println(tofu.newRenderer(DEMO_DOUBLE_BRACES)
        .setData(ImmutableMap.of(DEMO_DOUBLE_BRACES.SET_NAME, "prime numbers",
                                 DEMO_DOUBLE_BRACES.SET_MEMBERS,
                                     ImmutableList.of(2, 3, 5, 7, 11, 13)))
         .setMsgBundle(msgBundle)
         .render());
View Full Code Here

    // The Hebrew in the following example comes out as question marks in the output because
    // System.out (and by default stdout generally) is set up to use a Latin encoding. To see
    // this really in action, run the Javascript example.
    writeExampleHeader("demoBidiSupport");
    System.out.println(tofu.newRenderer(DEMO_BIDI_SUPPORT)
        .setData(ImmutableMap.of(DEMO_BIDI_SUPPORT.TITLE, "2008: A BiDi Odyssey",
                                 DEMO_BIDI_SUPPORT.AUTHOR, "John Doe, Esq.",
                                 DEMO_BIDI_SUPPORT.YEAR, "1973",
                                 DEMO_BIDI_SUPPORT.KEYWORDS,
                                 ImmutableList.of(
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.