org.apache.tapestry5.runtime

## Interface ComponentEvent

- All Superinterfaces:
    Event
  All Known Implementing Classes:
    ComponentEventImpl

      public interface ComponentEvent
      extends Event

  An event that may originate in application logic, or as a result of a client interaction (a GET or POST from the client).
  See Also:
    `ComponentResourcesCommon.triggerEvent(String, Object[], org.apache.tapestry5.ComponentEventCallback)`, `ComponentEventCallback`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `coerceContext(int index, String desiredTypeName)` Coerces a context value to a particular type.
    `Object[]` | `getContext()` Returns the underlying `EventContext` as a (possibly empty) array.
    `EventContext` | `getEventContext()` Returns the underlying event context.
    `boolean` | `matches(String eventType, String componentId, int parameterCount)` Returns true if the event matches the provided criteria and the event has not yet been aborted.

    - ### Methods inherited from interface org.apache.tapestry5.runtime.Event

      `isAborted, setMethodDescription, storeResult`

- - ### Method Detail

    - #### matches

          boolean matches(String eventType,
                          String componentId,
                          int parameterCount)

      Returns true if the event matches the provided criteria and the event has not yet been aborted.
      Parameters:
        `eventType` - the type of event (case insensitive match)
        `componentId` - component is to match against (case insensitive), or the empty string
        `parameterCount` - minimum number of context values
      Returns:
        true if the event matches (and has not yet been aborted)

    - #### coerceContext

          Object coerceContext(int index,
                               String desiredTypeName)

      Coerces a context value to a particular type. The context is an array of objects; typically it is an array of strings of extra path information encoded into the action URL.
      Parameters:
        `index` - the index of the context value
        `desiredTypeName` - the desired type
      Returns:
        the coerced value (a wrapper type if the desired type is a primitive)

    - #### getContext

          Object[] getContext()

      Returns the underlying `EventContext` as a (possibly empty) array.

    - #### getEventContext

          EventContext getEventContext()

      Returns the underlying event context.

5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.