Class ElementListenerMap

All Implemented Interfaces:
Serializable

public class ElementListenerMap extends NodeMap
Map of DOM events with server-side listeners. The key set of this map describes the event types for which listeners are present. The values associated with the keys are currently not used.

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

Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Field Details

    • ALWAYS_TRUE_FILTER

      public static final String ALWAYS_TRUE_FILTER
      Dummy filter string that always passes.
      See Also:
  • Constructor Details

    • ElementListenerMap

      public ElementListenerMap(StateNode node)
      Creates a new element listener map for the given node.
      Parameters:
      node - the node that the map belongs to
  • Method Details

    • add

      public DomListenerRegistration add(String eventType, DomEventListener listener)
      Add eventData for an event type.
      Parameters:
      eventType - the event type
      listener - the listener to add
      Returns:
      a handle for configuring and removing the listener
    • producePutChange

      protected boolean producePutChange(String key, boolean hadValueEarlier, Serializable newValue)
      Description copied from class: NodeMap
      Checks whether a MapPutChange should be produced.
      Overrides:
      producePutChange in class NodeMap
      Parameters:
      key - a key to produce a change
      hadValueEarlier - whether the value was already earlier in the map
      newValue - the new value for the key
      Returns:
      true if a change should be produced, false otherwise
    • collectChanges

      public void collectChanges(Consumer<NodeChange> collector)
      Description copied from class: NodeFeature
      Collects all changes that are recorded for this feature.
      Overrides:
      collectChanges in class NodeMap
      Parameters:
      collector - a consumer accepting node changes
    • fireEvent

      public void fireEvent(DomEvent event)
      Fires an event to all listeners registered for the given type.
      Parameters:
      event - the event to fire
    • getExpressions

      public Set<String> getExpressions(String eventName)
      Gets the event data expressions defined for the given event name. This method is currently only provided to facilitate unit testing.
      Parameters:
      eventName - the name of the event, not null
      Returns:
      an unmodifiable set of event data expressions, not null
      Since:
      3.0
    • getPropertySynchronizationMode

      public DisabledUpdateMode getPropertySynchronizationMode(String propertyName)
      Gets the most permissive update mode for any event registration that is configured to synchronize the given property.
      Parameters:
      propertyName - the property name to check, not null
      Returns:
      the most permissive update mode, or null if synchronization is not configured for the given property
      Since:
      1.3
    • hasAllowInertForProperty

      public boolean hasAllowInertForProperty(String propertyName)
      Returns true if any listener for the given property has allowInert enabled. Note that this means that enabling allowInert for any listener for a certain property will effectively allow it for all listeners for said property.
      Parameters:
      propertyName - the property name to check, not null
      Returns:
      true if allowInert is enabled for any listener for the given property, false otherwise
      Since:
      24.6.8