Interface NodeOwner

All Superinterfaces:
Serializable
All Known Implementing Classes:
NullOwner, StateTree

public interface NodeOwner extends Serializable
Abstract root of a state node tree. A node always belongs to one specific owner. The owner keeps track of metadata for its nodes.

For internal use only. May be renamed or removed in a future release.

Since:
1.0
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check if given node is registered to this node owner.
    void
    Marks a node owned by this instance as dirty.
    int
    Registers a node with this node owner.
    void
    Unregisters a node from this owner.
  • Method Details

    • register

      int register(StateNode node)
      Registers a node with this node owner. The new node should already be set to be owned by this instance.
      Parameters:
      node - the node to register
      Returns:
      the id of the registered node
    • unregister

      void unregister(StateNode node)
      Unregisters a node from this owner. This must be done before the node is set to not be owned by this instance.
      Parameters:
      node - the node to unregister
    • markAsDirty

      void markAsDirty(StateNode node)
      Marks a node owned by this instance as dirty. Dirty nodes are collected from an owner using StateTree.collectDirtyNodes().
      Parameters:
      node - the node to be marked as dirty
    • hasNode

      boolean hasNode(StateNode node)
      Check if given node is registered to this node owner.
      Parameters:
      node - node to check registration status for
      Returns:
      true if node is registered