Interface BinderContext


public interface BinderContext
Binder context which is passed to the BindingStrategy instances enabling them to delegate the creation of any child nodes.
Since:
1.0
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(StateNode stateNode, elemental.dom.Node node)
    Binds a DOM node for the given state node.
    elemental.dom.Node
    Creates and binds a DOM node for the given state node.
    <T extends BindingStrategy<?>>
    JsArray<T>
    Gets the strategies with a specific type T using filtering predicate.
  • Method Details

    • createAndBind

      elemental.dom.Node createAndBind(StateNode node)
      Creates and binds a DOM node for the given state node. For state nodes based on templates, the root element of the template is returned.
      Parameters:
      node - the state node for which to create a DOM node, not null
      Returns:
      the DOM node, not null
    • bind

      void bind(StateNode stateNode, elemental.dom.Node node)
      Binds a DOM node for the given state node.
      Parameters:
      stateNode - the state node to bind, not null
      node - the DOM node, not null
    • getStrategies

      <T extends BindingStrategy<?>> JsArray<T> getStrategies(Predicate<BindingStrategy<?>> predicate)
      Gets the strategies with a specific type T using filtering predicate.

      Predicate normally should be based on Class<T>#isInstance() but this method is not available in GWT so predicate instanceof T should be used. It's the developer responsibility to make sure that the resulting strategies types are correct to avoid ClassCastException.

      Type Parameters:
      T - the array type
      Parameters:
      predicate - predicate to filter strategies using type T.
      Returns:
      collection of filtered strategies