Class DomEventInfo

java.lang.Object
com.vaadin.flow.component.internal.DomEventInfo

public final class DomEventInfo extends Object
What a component event type annotated with DomEvent is fired with: the constructor that creates it from a DOM event and the EventData of its parameters. Computed from the event type on creation and never cached here: ComponentEventBusUtil caches it for the application, and the build creates it without a cache, so that a class it loads with a class loader it closes afterwards is not kept by a static map.

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

Since:
25.4
  • Constructor Details

    • DomEventInfo

      public DomEventInfo(Class<? extends ComponentEvent<?>> type)
      Scans the given event type.
      Parameters:
      type - the component event type, not null
      Throws:
      IllegalArgumentException - if the event type has no suitable DOM event constructor
  • Method Details

    • getDataExpressions

      public LinkedHashMap<String,Class<?>> getDataExpressions()
      Gets the event data expressions mapped to the Java type of the constructor parameter they are passed as, in parameter order.
      Returns:
      the event data expressions, not null
    • getListenerEventData

      public List<String> getListenerEventData()
      Gets the event data to add to a DOM listener registration, with expressions for components and elements mapped like DomListenerRegistration.addEventDataElement(String) does.
      Returns:
      an unmodifiable list, not null
    • getExpressionEventData

      public List<String> getExpressionEventData()
      Gets the event data of getListenerEventData() that the client gets as it is, which is all of it except getBundledEventData().
      Returns:
      an unmodifiable list, not null
    • getBundledEventData

      public List<String> getBundledEventData()
      Gets the event data of getListenerEventData() that the build puts into the bundle as functions, see BundledEventData.
      Returns:
      an unmodifiable list, empty if there are none
    • getEventConstructor

      public Constructor<? extends ComponentEvent<?>> getEventConstructor()
      Gets the constructor to use when creating the event from a DOM event.
      Returns:
      the constructor, not null