Package org.jboss.elemento
Class ElementsBag
java.lang.Object
org.jboss.elemento.ElementsBag
- All Implemented Interfaces:
TypedBuilder<Iterable<Element>,
ElementsBag>
Class to collect
Element
s
ElementsBag bag = bag();
Map<String, Todo> data = ...;
data.forEach((text, todo) -> {
bag.add(dt().textContent(text));
bag.add(dd().add(new TodoElement(todo)));
});
HTMLDListElement element = dl().addAll(bag.elements()).element();
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds the given element.Adds the given element by callingelement.element()
.Adds all elements.addAll
(HTMLElement... elements) Adds all elements.Adds all elements.Adds all elements.elements()
that()
In order to make builders work with inheritance, sub-builders must return a reference to their instance.
-
Constructor Details
-
ElementsBag
public ElementsBag()
-
-
Method Details
-
that
Description copied from interface:TypedBuilder
In order to make builders work with inheritance, sub-builders must return a reference to their instance.- Specified by:
that
in interfaceTypedBuilder<Iterable<Element>,
ElementsBag>
-
elements
- Returns:
- the elements in this bag.
-
add
Adds the given element. -
add
Adds the given element by callingelement.element()
. -
addAll
Adds all elements. -
addAll
Adds all elements. -
addAll
Adds all elements. -
addAll
Adds all elements.
-