Package com.vaadin.client.flow.binding
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 TypeMethodDescriptionvoidBinds a DOM node for the given state node.elemental.dom.NodecreateAndBind(StateNode node) Creates and binds a DOM node for the given state node.<T extends BindingStrategy<?>>
JsArray<T> getStrategies(Predicate<BindingStrategy<?>> predicate) Gets the strategies with a specific typeTusing filteringpredicate.
-
Method Details
-
createAndBind
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, notnull- Returns:
- the DOM node, not
null
-
bind
Binds a DOM node for the given state node.- Parameters:
stateNode- the state node to bind, notnullnode- the DOM node, notnull
-
getStrategies
Gets the strategies with a specific typeTusing filteringpredicate.Predicate normally should be based on
Class<T>#isInstance()but this method is not available in GWT so predicateinstanceof Tshould be used. It's the developer responsibility to make sure that the resulting strategies types are correct to avoidClassCastException.- Type Parameters:
T- the array type- Parameters:
predicate- predicate to filter strategies using typeT.- Returns:
- collection of filtered strategies
-