org.apache.tapestry.binding
Class ListenerMethodBinding

java.lang.Object
  extended by org.apache.tapestry.binding.AbstractBinding
      extended by org.apache.tapestry.binding.ListenerMethodBinding
All Implemented Interfaces:
org.apache.hivemind.Locatable, IActionListener, IBinding

public class ListenerMethodBinding
extends AbstractBinding
implements IActionListener

Since:
4.0
Author:
Howard M. Lewis Ship

Field Summary
 
Fields inherited from class org.apache.tapestry.binding.AbstractBinding
_description
 
Constructor Summary
ListenerMethodBinding(String description, ValueConverter valueConverter, org.apache.hivemind.Location location, IComponent component, String methodName)
           
 
Method Summary
 void actionTriggered(IComponent component, IRequestCycle cycle)
          Method invoked by the component (an DirectLink or Form, when its URL is triggered.
protected  void extendDescription(StringBuffer buffer)
          Does nothing, subclasses may override to add additional information.
 Object getComponent()
          Returns the component to which this binding is connected; this is currently only used when building certain exceptions.
 String getMethodName()
          The actual method name that this listener represents.
 Object getObject()
          Returns this binding object; the binding object delegates to the actual listener.
 
Methods inherited from class org.apache.tapestry.binding.AbstractBinding
createReadOnlyBindingException, getDescription, getLocation, getObject, getValueConverter, isInvariant, setObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListenerMethodBinding

public ListenerMethodBinding(String description,
                             ValueConverter valueConverter,
                             org.apache.hivemind.Location location,
                             IComponent component,
                             String methodName)
Method Detail

getComponent

public Object getComponent()
Description copied from class: AbstractBinding
Returns the component to which this binding is connected; this is currently only used when building certain exceptions. This implementation returns null.

Overrides:
getComponent in class AbstractBinding
Returns:
The IComponent object this binding is set against.

getObject

public Object getObject()
Returns this binding object; the binding object delegates to the actual listener. This allows us to intercept errors and report the location of the binding.

Specified by:
getObject in interface IBinding

getMethodName

public String getMethodName()
Description copied from interface: IActionListener
The actual method name that this listener represents.

Specified by:
getMethodName in interface IActionListener
Returns:
The method name this listener is bound to.

actionTriggered

public void actionTriggered(IComponent component,
                            IRequestCycle cycle)
Description copied from interface: IActionListener
Method invoked by the component (an DirectLink or Form, when its URL is triggered.

Specified by:
actionTriggered in interface IActionListener
Parameters:
component - The component which was "triggered".
cycle - The request cycle in which the component was triggered.

extendDescription

protected void extendDescription(StringBuffer buffer)
Description copied from class: AbstractBinding
Does nothing, subclasses may override to add additional information.

Overrides:
extendDescription in class AbstractBinding


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