Package com.vaadin.flow.dom.impl
Class AbstractNodeStateProvider
java.lang.Object
com.vaadin.flow.dom.impl.AbstractNodeStateProvider
- All Implemented Interfaces:
ElementStateProvider,Serializable
- Direct Known Subclasses:
BasicElementStateProvider,ShadowRootStateProvider
Abstract implementation of the
ElementStateProvider related to the
composition essence of the provider.
For internal use only. May be renamed or removed in a future release.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendVirtualChild(StateNode node, Element child, String type, String payload) Append the given element as a virtual child.voidattachExistingElement(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback) Attaches a child element with the giventagNamewhich is the next sibling for thepreviousSibling.Returns the child element at the given position.intgetChildCount(StateNode node) Gets the number of child elements.protected abstract Node<?> Gets the flyweight instance for thenodesupported by the provider.Gets the parent element.protected abstract Class<? extends NodeFeature>[]Returns the features supported by the provider.voidinsertChild(StateNode node, int index, Element child) Inserts the given child at the given position.voidremoveAllChildren(StateNode node) Removes all child elements.voidremoveChild(StateNode node, int index) Removes the child at the given position.voidremoveChild(StateNode node, Element child) Removes the given child.booleanChecks if the element state provider supports the given state node.protected voidvisitDescendants(Node<?> node, NodeVisitor visitor) Apply thevisitorfor the descendants of thenode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.dom.ElementStateProvider
addEventListener, addPropertyChangeListener, attachShadow, getAttribute, getAttributeNames, getClassList, getComponent, getProperty, getPropertyNames, getShadowRoot, getStyle, getTag, getTextContent, hasAttribute, hasProperty, isTextNode, isVisible, removeAttribute, removeProperty, setAttribute, setAttribute, setComponent, setProperty, setTextContent, setVisible, visit
-
Constructor Details
-
AbstractNodeStateProvider
public AbstractNodeStateProvider()
-
-
Method Details
-
supports
Description copied from interface:ElementStateProviderChecks if the element state provider supports the given state node.- Specified by:
supportsin interfaceElementStateProvider- Parameters:
node- the state node to check- Returns:
- true if the element state provider is compatible with the given state node, false otherwise
-
getProviderFeatures
Returns the features supported by the provider.- Returns:
- features supported by the provider
-
getParent
Description copied from interface:ElementStateProviderGets the parent element.- Specified by:
getParentin interfaceElementStateProvider- Parameters:
node- the node containing the data- Returns:
- the parent element or null if the element has no parent
-
getChildCount
Description copied from interface:ElementStateProviderGets the number of child elements.- Specified by:
getChildCountin interfaceElementStateProvider- Parameters:
node- the node containing the data- Returns:
- the number of child elements
-
getChild
Description copied from interface:ElementStateProviderReturns the child element at the given position.- Specified by:
getChildin interfaceElementStateProvider- Parameters:
node- the node containing the dataindex- the index of the child element to return- Returns:
- the child element
-
insertChild
Description copied from interface:ElementStateProviderInserts the given child at the given position.- Specified by:
insertChildin interfaceElementStateProvider- Parameters:
node- the node containing the dataindex- the position at which to insert the new childchild- the child element to insert
-
removeChild
Description copied from interface:ElementStateProviderRemoves the child at the given position.- Specified by:
removeChildin interfaceElementStateProvider- Parameters:
node- the node containing the dataindex- the position of the child element to remove
-
removeAllChildren
Description copied from interface:ElementStateProviderRemoves all child elements.- Specified by:
removeAllChildrenin interfaceElementStateProvider- Parameters:
node- the node containing the data
-
removeChild
Description copied from interface:ElementStateProviderRemoves the given child.- Specified by:
removeChildin interfaceElementStateProvider- Parameters:
node- the node containing the datachild- the child element to remove
-
attachExistingElement
public void attachExistingElement(StateNode node, String tagName, Element previousSibling, ChildElementConsumer callback) Description copied from interface:ElementStateProviderAttaches a child element with the giventagNamewhich is the next sibling for thepreviousSibling.The
previousSiblingparameter value can benullwhich means that the very first child with the giventagNamewill be used to attach (if any).- Specified by:
attachExistingElementin interfaceElementStateProvider- Parameters:
node- the parent nodetagName- the tag name of the element to attach, notnullpreviousSibling- previous sibling, may benullcallback- the callback which will be invoked with a server side element instance or an error will be reported, notnull
-
appendVirtualChild
Description copied from interface:ElementStateProviderAppend the given element as a virtual child.- Specified by:
appendVirtualChildin interfaceElementStateProvider- Parameters:
node- the node containing the datachild- the child element to addtype- the type of additional payload datapayload- the additional payload data
-
visitDescendants
Apply thevisitorfor the descendants of thenode.- Parameters:
node- the node whose descendants are targets to apply the visitorvisitor- the visitor to apply
-
getNode
Gets the flyweight instance for thenodesupported by the provider.- Parameters:
node- the node to wrap into flyweight- Returns:
- the flyweight instance for the
node - See Also:
-