Interface BindingStrategy<T extends elemental.dom.Node>

Type Parameters:
T - a DOM node type which strategy is applicable for
All Known Implementing Classes:
SimpleElementBindingStrategy, TextBindingStrategy

public interface BindingStrategy<T extends elemental.dom.Node>
Binding strategy/factory for StateNodes.

Only one strategy may be applicable for the given StateNode instance. Once the applicable strategy is identified it's used to produce a Node based on the StateNode instance and bind it.

Since:
1.0
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(StateNode stateNode, T domNode, BinderContext context)
    Binds a DOM node to the stateNode using context to create and bind nodes of other types.
    Creates a DOM node for the node.
    default String
    Gets the tag value from the NodeFeatures.ELEMENT_DATA feature for the node.
    boolean
    Returns true is the strategy is applicable to the node.
  • Method Details

    • create

      T create(StateNode node)
      Creates a DOM node for the node.
      Parameters:
      node - the state node for which to create a DOM node, not null
      Returns:
      the DOM node, not null
    • isApplicable

      boolean isApplicable(StateNode node)
      Returns true is the strategy is applicable to the node.
      Parameters:
      node - the state node to check against of
      Returns:
      true if the strategy is applicable to the node
    • bind

      void bind(StateNode stateNode, T domNode, BinderContext context)
      Binds a DOM node to the stateNode using context to create and bind nodes of other types.
      Parameters:
      stateNode - the state node to bind, not null
      domNode - the DOM node, not null
      context - binder context to create and construct HTML nodes of other types
    • getTag

      default String getTag(StateNode node)
      Gets the tag value from the NodeFeatures.ELEMENT_DATA feature for the node.
      Parameters:
      node - the state node
      Returns:
      tag of the node