View Javadoc

1   package net.sf.tacos.binding;
2   
3   import org.apache.hivemind.Location;
4   import org.apache.tapestry.binding.AbstractBinding;
5   import org.apache.tapestry.coerce.ValueConverter;
6   
7   /**
8    * Implementation of {@link org.apache.tapestry.IBinding} that stores a static
9    * (invariant) string as the value. This string represents a name of an javascript function.
10   * 
11   * @author Igor Drobiazko
12   * @since 4.1
13   */
14  public class CallbackFunctionBinding extends AbstractBinding implements ICallbackFunction{
15  	
16  	protected CallbackFunctionBinding(String description, ValueConverter valueConverter, Location location, String value) {
17  		super(value, valueConverter, location);
18  	}
19  	
20  	/**
21  	 * {@inheritDoc}
22  	 */
23  	public Object getObject() {
24  		return getFunctionName();
25  	}
26  	
27  	/**
28  	 * {@inheritDoc}
29  	 */
30  	public String getFunctionName(){
31  		return getDescription();
32  	}
33  	
34  	/**
35  	 * Returns the string representation of the object.
36  	 */
37      public String toString(){
38          return "CallbackFunctionBinding[" + getFunctionName() + "]";
39      }
40  
41  }