Interface CustomEvent

All Superinterfaces:
Event

public interface CustomEvent extends Event
Represents a custom DOM event
  • Method Details

    • getProperty

      @Nullable @Nullable Object getProperty(@NotNull @NotNull String propertyName)
      Get a property value
      Parameters:
      propertyName - Property name
      Returns:
      Property value, or null, if the property isn't set
      Throws:
      NullPointerException - If propertyName is null
    • getPropertyAs

      @Nullable <T> T getPropertyAs(@NotNull @NotNull String propertyName, Class<T> type)
      Get a property value and cast it to a specified type
      Parameters:
      propertyName - Property name
      type - Property type
      Returns:
      Property value casted to the specified type, or null, if the property isn't set, or if the property's type wasn't an instance of the specified type.
      Throws:
      NullPointerException - If propertyName or type is null
    • getProperties

      @NotNull @NotNull Set<String> getProperties()
      Get a set of all property names
      Returns:
      Property name set
    • initEvent

      void initEvent(@Nullable @Nullable Element target, boolean bubbles, boolean cancellable, @Nullable @Nullable Map<String,Object> properties)
      Initializes the event, this must be called before dispatching the event.
      Parameters:
      target - Target element
      bubbles - Whether the event bubbles up through the document tree
      cancellable - Whether the event can be cancelled
      properties - Map of event properties, or null, if no extra properties are required.