Class ComponentEventImpl
java.lang.Object
org.apache.tapestry5.internal.services.EventImpl
org.apache.tapestry5.internal.services.ComponentEventImpl
- All Implemented Interfaces:
ComponentEvent
,Event
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionComponentEventImpl
(String eventType, String originatingComponentId, EventContext context, ComponentEventCallback handler, ComponentPageElementResources elementResources, boolean exactParameterCountMatch, ComponentModel model, org.slf4j.Logger logger) -
Method Summary
Modifier and TypeMethodDescriptioncoerceContext
(int index, String desiredTypeName) Coerces a context value to a particular type.Object[]
Returns the underlyingEventContext
as a (possibly empty) array.Returns the underlying event context.boolean
Returns true if the event matches the provided criteria and the event has not yet been aborted.toString()
Methods inherited from class org.apache.tapestry5.internal.services.EventImpl
getMethodDescription, isAborted, setMethodDescription, storeResult
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.tapestry5.runtime.ComponentEvent
matches
Methods inherited from interface org.apache.tapestry5.runtime.Event
isAborted, setMethodDescription, storeResult
-
Constructor Details
-
ComponentEventImpl
public ComponentEventImpl(String eventType, String originatingComponentId, EventContext context, ComponentEventCallback handler, ComponentPageElementResources elementResources, boolean exactParameterCountMatch, ComponentModel model, org.slf4j.Logger logger) - Parameters:
eventType
- non blank string used to identify the type of event that was triggeredoriginatingComponentId
- the id of the component that triggered the eventcontext
- provides access to parameter valueshandler
- invoked when a non-null return value is obtained from an event handler methodelementResources
- provides access to common resources and servicesexactParameterCountMatch
- theSymbol
indicating an exact match on parameter count in theEventContext
.model
- theComponentModel
of the component originating the event.logger
- used to log method invocations
-
-
Method Details
-
toString
-
matches
Description copied from interface:ComponentEvent
Returns true if the event matches the provided criteria and the event has not yet been aborted.- Specified by:
matches
in interfaceComponentEvent
- Parameters:
eventType
- the type of event (case insensitive match)componentId
- component is to match against (case insensitive), or the empty stringparameterCount
- minimum number of context values- Returns:
- true if the event matches (and has not yet been aborted)
-
coerceContext
Description copied from interface:ComponentEvent
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.- Specified by:
coerceContext
in interfaceComponentEvent
- Parameters:
index
- the index of the context valuedesiredTypeName
- the desired type- Returns:
- the coerced value (a wrapper type if the desired type is a primitive)
-
getContext
Description copied from interface:ComponentEvent
Returns the underlyingEventContext
as a (possibly empty) array.- Specified by:
getContext
in interfaceComponentEvent
-
getEventContext
Description copied from interface:ComponentEvent
Returns the underlying event context.- Specified by:
getEventContext
in interfaceComponentEvent
-