Getting Started |
Section
The Section class is analagous to the Section.show()The Section.show() method obtains a Section nested within the current Section, makes it visible, and returns it. (Note that the template Section itself is automatically "shown" when it is obtained from the TemplateManager).
//Show the "Row" Section three times, and within each of those,
//show the "Col" section twice:
for (int i=0; i<=3; i++) {
Section row=template.show("Row");
Section col1=row.show("Col"),
col2=row.show("Col");
}
Every time a Section is repeated, it makes a copy of itself and appends the copy to itself. Each copy has its own internal Sections & Slots. Section.fillin()The Section.fillin() method fills in named Slots in the template. For example:
//Fillin the slot "FullName" with the value "Mr. Jones":
mySection.fillin("FullName", "Mr. Jones");
Printing the template
The Section.appendTo() method prints the Section to any instance of //Print the template to System.out: myTemplate.appendTo(System.out); Next page: Additional Classes & Things |