org.apache.tapestry.listener
Interface ListenerMap

All Known Implementing Classes:
ListenerMapImpl

public interface ListenerMap

Author:
Howard M. Lewis Ship

Method Summary
 boolean canProvideListener(String name)
          Returns true if this ListenerMapImpl can provide a listener with the given name.
 IActionListener getImplicitListener(IComponent component)
          Gets a listener on the given component generated from the capitalized component id, prefixed by "do".
 IActionListener getListener(String name)
          Gets a listener for the given name (which is both a property name and a method name).
 Collection getListenerNames()
          Returns an unmodifiable collection of the names of the listeners implemented by the target class.
 

Method Detail

getListener

IActionListener getListener(String name)
Gets a listener for the given name (which is both a property name and a method name). The listener is created as needed, but is also cached for later use. The returned object implements the IActionListener.

Parameters:
name - the name of the method to invoke (the most appropriate method will be selected if there are multiple overloadings of the same method name)
Returns:
an object implementing IActionListener.
Throws:
org.apache.hivemind.ApplicationRuntimeException - if the listener can not be created.

getImplicitListener

IActionListener getImplicitListener(IComponent component)
Gets a listener on the given component generated from the capitalized component id, prefixed by "do". For example, jwcid="clear@DirectLink" would have a listener called doClear().

Parameters:
component - the component whose id is used to make up the name of the expected listener
Returns:
an object implementing IActionListener.
Throws:
org.apache.hivemind.ApplicationRuntimeException - if the listener can not be found on the component

getListenerNames

Collection getListenerNames()
Returns an unmodifiable collection of the names of the listeners implemented by the target class.

Returns:
List of known listener names.
Since:
1.0.6

canProvideListener

boolean canProvideListener(String name)
Returns true if this ListenerMapImpl can provide a listener with the given name.

Parameters:
name - Name of the method to check listener existance of.
Returns:
True if there is a matching listener of that name, false otherwise.
Since:
2.2


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.