001// Licensed under the Apache License, Version 2.0 (the "License");
002// you may not use this file except in compliance with the License.
003// You may obtain a copy of the License at
004//
005// http://www.apache.org/licenses/LICENSE-2.0
006//
007// Unless required by applicable law or agreed to in writing, software
008// distributed under the License is distributed on an "AS IS" BASIS,
009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010// See the License for the specific language governing permissions and
011// limitations under the License.
012
013package org.apache.tapestry5.internal.transform;
014
015import org.apache.tapestry5.runtime.ComponentEvent;
016
017/**
018 * Supplies one parameter value when invoking a component event handler method. In general,
019 * this involves extracting a value form the event's context and coercing it to a type
020 * appropriate to the parameter.
021 *
022 * These values are accumulated and used to invoke the event handler method.
023 *
024 * @since 5.2.0
025 */
026public interface EventHandlerMethodParameterProvider
027{
028    /**
029     * Extract the value and coerce it to the correct type.
030     *
031     * @return value that can be passed as a method parameter
032     */
033    Object valueForEventHandlerMethodParameter(ComponentEvent event);
034}