T - the type of the item in the bulletspublic class BulletedSection<T> extends Object implements Section
Section for list of items using a TemplateRenderer. The template is
rendered with the registered items set in the model with a configurable item name.| Constructor and Description |
|---|
BulletedSection(TemplateRenderer templateRenderer,
String templateName)
Create a new instance adding items in the model with the
items key. |
BulletedSection(TemplateRenderer templateRenderer,
String templateName,
String itemName)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
BulletedSection<T> |
addItem(T item)
Add an item to the list.
|
List<T> |
getItems()
Return an immutable list of the registered items.
|
boolean |
isEmpty()
Specify whether this section is empty.
|
void |
write(PrintWriter writer)
Write the content of the section to the specified
writer. |
public BulletedSection(TemplateRenderer templateRenderer, String templateName)
items key.templateRenderer - the template renderer to usetemplateName - the name of the templatepublic BulletedSection(TemplateRenderer templateRenderer, String templateName, String itemName)
templateRenderer - the template renderer to usetemplateName - the name of the templateitemName - the key of the items in the modelpublic BulletedSection<T> addItem(T item)
item - the item to addpublic boolean isEmpty()
true if no item is registeredpublic List<T> getItems()
public void write(PrintWriter writer) throws IOException
Sectionwriter.write in interface Sectionwriter - the writer to useIOException - if writing the section failedCopyright © 2021 Pivotal Software, Inc.. All rights reserved.