encoding ISO-8859-1 package com.myapp.greeting import java.util.List; import com.myapp.util.GreetingHelper import ./flowers.Flower import ../util/StringUtil prolog /** prolog * What a template. prolog */ prolog @SuppressWarnings("unused") template(String name, List flowers, GreetingHelper helper, int x, int y) package-access abstract extends MyBaseTemplate implements Adorable, BattleNotificationSender mixin html, lang, MyMixin throws IOException, IllegalArgumentException {{ Hello World Hello World Hello <%name%>! 1 + 2 = <%1 + 2%> SPAM GREETINGS <%name.toUpperCase()%> Hey <%name%>, 1 + 2 = <%1 + 2%> Hey <% doSomething(name); %>! Hey <% html.text(name); %>, 100 * 321 is <% lang.format(100*321); %> @if (name.length() > 20) howdy big <%name%> @else howdy shorty <%name%> @for (int i=0; i-th character in your name is <%name.charAt(i)%>
Hey <%name%> <%%> what's up?
hello <%%> <%%>@... <%%>[... Hey <%/%> @if (name.length() > 0) big <%/%> <%name%> Hey <%? name.length() > 0 %>big <%?%><%name%> @calcArea(); The area of <%x%> times <%y%> is <%printArea();%>. }} private void printArea() {{ <%area%>! }} private void calcArea() { area = x * y; } private int area;