Package com.vaadin.client.flow.binding
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 TypeMethodDescriptionvoidbind(StateNode stateNode, T domNode, BinderContext context) Binds a DOM node to thestateNodeusingcontextto create and bind nodes of other types.Creates a DOM node for thenode.default StringGets the tag value from theNodeFeatures.ELEMENT_DATAfeature for thenode.booleanisApplicable(StateNode node) Returnstrueis the strategy is applicable to thenode.
-
Method Details
-
create
Creates a DOM node for thenode.- Parameters:
node- the state node for which to create a DOM node, notnull- Returns:
- the DOM node, not
null
-
isApplicable
Returnstrueis the strategy is applicable to thenode.- Parameters:
node- the state node to check against of- Returns:
trueif the strategy is applicable to the node
-
bind
Binds a DOM node to thestateNodeusingcontextto create and bind nodes of other types.- Parameters:
stateNode- the state node to bind, notnulldomNode- the DOM node, notnullcontext- binder context to create and construct HTML nodes of other types
-
getTag
Gets the tag value from theNodeFeatures.ELEMENT_DATAfeature for thenode.- Parameters:
node- the state node- Returns:
- tag of the
node
-