Class Renderer<SOURCE>

java.lang.Object
com.vaadin.flow.data.renderer.Renderer<SOURCE>
Type Parameters:
SOURCE - the type of the input object used inside the template
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ColumnPathRenderer, EditorRenderer, LitRenderer

public abstract class Renderer<SOURCE> extends Object implements Serializable
Base class for all renderers - classes that take a given model object as input and handles their rendering to the client side when requested.
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • Renderer

      public Renderer()
  • Method Details

    • render

      public Rendering<SOURCE> render(Element container, DataKeyMapper<SOURCE> keyMapper)
      Registers a renderer function to the given container element. Creates the setup to handle rendering of individual data items as requested by the renderer function invocation. The renderer function name defaults to "renderer".
      Parameters:
      container - the element which accepts the renderer function on the client.
      keyMapper - mapper used internally to fetch items by key and to provide keys for given items.
      Returns:
      the context of the rendering, that can be used by the components to provide extra customization
    • render

      public abstract Rendering<SOURCE> render(Element container, DataKeyMapper<SOURCE> keyMapper, String rendererName)
      Registers a renderer function with the given name to the given container element. Creates the setup to handle rendering of individual data items as requested by the renderer function invocation.
      Parameters:
      container - the element which accepts the renderer function on the client.
      keyMapper - mapper used internally to fetch items by key and to provide keys for given items.
      rendererName - name of the renderer function the container element accepts
      Returns:
      the context of the rendering, that can be used by the components to provide extra customization