org.apache.tapestry.binding
Class ListenerBinding

java.lang.Object
  extended by org.apache.tapestry.binding.AbstractBinding
      extended by org.apache.tapestry.binding.ListenerBinding
All Implemented Interfaces:
IActionListener, IBinding, ILocatable

public class ListenerBinding
extends AbstractBinding
implements IActionListener

A very specialized binding that can be used as an IActionListener, executing a script in a scripting language, via Bean Scripting Framework.

Since:
3.0
Version:
$Id: ListenerBinding.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
ListenerBinding(IComponent component, String language, String script, ILocation location)
           
 
Method Summary
 void actionTriggered(IComponent component, IRequestCycle cycle)
          A ListenerBinding is also a IActionListener.
 boolean getBoolean()
          Always returns true.
 double getDouble()
          Gets the value of the Binding using IBinding.getObject() and coerces it to a double.
 int getInt()
          Gets the value of the Binding using IBinding.getObject() and coerces it to an int.
 Object getObject()
          Returns this.
 String getString()
          Returns the underlying script.
 
Methods inherited from class org.apache.tapestry.binding.AbstractBinding
createReadOnlyBindingException, getLocation, getObject, isInvariant, isWrapper, setBoolean, setDouble, setInt, setObject, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListenerBinding

public ListenerBinding(IComponent component,
                       String language,
                       String script,
                       ILocation location)
Method Detail

getBoolean

public boolean getBoolean()
Always returns true.

Specified by:
getBoolean in interface IBinding
Overrides:
getBoolean in class AbstractBinding
See Also:
Tapestry.evaluateBoolean(Object)

getInt

public int getInt()
Description copied from interface: IBinding
Gets the value of the Binding using IBinding.getObject() and coerces it to an int. Strings will be parsed, and other java.lang.Number classes will have intValue() invoked.

Specified by:
getInt in interface IBinding
Overrides:
getInt in class AbstractBinding

getDouble

public double getDouble()
Description copied from interface: IBinding
Gets the value of the Binding using IBinding.getObject() and coerces it to a double. Strings will be parsed, and other java.lang.Number classes will have doubleValue() invoked.

Specified by:
getDouble in interface IBinding
Overrides:
getDouble in class AbstractBinding

getString

public String getString()
Returns the underlying script.

Specified by:
getString in interface IBinding
Overrides:
getString in class AbstractBinding

getObject

public Object getObject()
Returns this.

Specified by:
getObject in interface IBinding

actionTriggered

public void actionTriggered(IComponent component,
                            IRequestCycle cycle)
A ListenerBinding is also a IActionListener. It registers a number of beans with the BSF manager and invokes the script.

Registers the following bean:

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