org.apache.tapestry.listener
Class ListenerMapImpl

java.lang.Object
  extended by org.apache.tapestry.listener.ListenerMapImpl
All Implemented Interfaces:
ListenerMap

public class ListenerMapImpl
extends Object
implements ListenerMap

Since:
4.0
Author:
Howard M. Lewis Ship

Constructor Summary
ListenerMapImpl(Object target, Map invokers)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerMapImpl

public ListenerMapImpl(Object target,
                       Map invokers)
Method Detail

canProvideListener

public boolean canProvideListener(String name)
Description copied from interface: ListenerMap
Returns true if this ListenerMapImpl can provide a listener with the given name.

Specified by:
canProvideListener in interface ListenerMap
Parameters:
name - Name of the method to check listener existance of.
Returns:
True if there is a matching listener of that name, false otherwise.

getListener

public IActionListener getListener(String name)
Description copied from interface: ListenerMap
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.

Specified by:
getListener in interface ListenerMap
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.

getImplicitListener

public IActionListener getImplicitListener(IComponent component)
Description copied from interface: ListenerMap
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().

Specified by:
getImplicitListener in interface ListenerMap
Parameters:
component - the component whose id is used to make up the name of the expected listener
Returns:
an object implementing IActionListener.

getListenerNames

public Collection getListenerNames()
Description copied from interface: ListenerMap
Returns an unmodifiable collection of the names of the listeners implemented by the target class.

Specified by:
getListenerNames in interface ListenerMap
Returns:
List of known listener names.


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