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 forStateNodes.Only one strategy may be applicable for the given
StateNodeinstance. Once the applicable strategy is identified it's used to produce aNodebased on theStateNodeinstance and bind it.- Since:
- 1.0
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidbind(StateNode stateNode, T domNode, BinderContext context)Binds a DOM node to thestateNodeusingcontextto create and bind nodes of other types.Tcreate(StateNode node)Creates a DOM node for thenode.default StringgetTag(StateNode node)Gets the tag value from theNodeFeatures.ELEMENT_DATAfeature for thenode.booleanisApplicable(StateNode node)Returnstrueis the strategy is applicable to thenode.
-
-
-
Method Detail
-
create
T create(StateNode node)
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
boolean isApplicable(StateNode node)
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
void bind(StateNode stateNode, T domNode, BinderContext context)
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
default String getTag(StateNode node)
Gets the tag value from theNodeFeatures.ELEMENT_DATAfeature for thenode.- Parameters:
node- the state node- Returns:
- tag of the
node
-
-