Interface ElementContainerMethods<E extends Element, B extends TypedBuilder<E,B>>

All Superinterfaces:
IsElement<E>, TypedBuilder<E,B>
All Known Subinterfaces:
ElementContainerDelegate<E,B>
All Known Implementing Classes:
HTMLContainerBuilder, Link, MathMLContainerMethods, SVGContainerBuilder

public interface ElementContainerMethods<E extends Element, B extends TypedBuilder<E,B>> extends TypedBuilder<E,B>, IsElement<E>
Provides methods and default implementations for adding elements.

TodoRepository repository = new TodoRepository();
TodoElement[] elements = repository.todos().stream()
        .map(TodoElement::new)
        .toArray(TodoElement[]::new);
HTMLUListElement ul = ul()
        .addAll(elements)
        .element();
  • Method Details

    • add

      default B add(String text)
      Adds the given text as a text node.
    • add

      default B add(Node node)
      Adds the given node.
    • add

      default B add(IsElement<?> element)
      Adds the given element by calling element.element().
    • add

      default B add(Supplier<Node> supplier)
      Add the element returned by the supplier.
    • addAll

      default B addAll(Node... nodes)
      Adds all nodes.
    • addAll

      default B addAll(Element... elements)
      Adds all elements.
    • addAll

      default B addAll(HTMLElement... elements)
      Adds all HTML elements.
    • addAll

      default B addAll(IsElement<?>... elements)
      Adds all elements.
    • addAll

      default B addAll(Iterable<?> elements)
      Adds all elements.
    • addAll

      default B addAll(Supplier<Iterable<?>> supplier)
      Adds all elements returned by the supplier.