Class BulletedSection<T>
java.lang.Object
io.spring.initializr.generator.io.text.BulletedSection<T>
- Type Parameters:
T- the type of the item in the bullets
- All Implemented Interfaces:
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.- Author:
- Madhura Bhave
-
Constructor Summary
ConstructorsConstructorDescriptionBulletedSection(TemplateRenderer templateRenderer, String templateName) Create a new instance adding items in the model with theitemskey.BulletedSection(TemplateRenderer templateRenderer, String templateName, String itemName) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionAdd an item to the list.getItems()Return an immutable list of the registered items.booleanisEmpty()Specify whether this section is empty.voidwrite(PrintWriter writer) Write the content of the section to the specifiedwriter.
-
Constructor Details
-
BulletedSection
Create a new instance adding items in the model with theitemskey.- Parameters:
templateRenderer- the template renderer to usetemplateName- the name of the template
-
BulletedSection
Create a new instance.- Parameters:
templateRenderer- the template renderer to usetemplateName- the name of the templateitemName- the key of the items in the model
-
-
Method Details
-
addItem
Add an item to the list.- Parameters:
item- the item to add- Returns:
- this for method chaining
-
isEmpty
public boolean isEmpty()Specify whether this section is empty.- Returns:
trueif no item is registered
-
getItems
Return an immutable list of the registered items.- Returns:
- the registered items
-
write
Description copied from interface:SectionWrite the content of the section to the specifiedwriter.- Specified by:
writein interfaceSection- Parameters:
writer- the writer to use- Throws:
IOException- if writing the section failed
-