001    package net.sf.tacos.binding;
002    
003    import org.apache.hivemind.Location;
004    import org.apache.tapestry.binding.AbstractBinding;
005    import org.apache.tapestry.coerce.ValueConverter;
006    
007    /**
008     * Implementation of {@link org.apache.tapestry.IBinding} that stores a static
009     * (invariant) string as the value. This string represents a name of an javascript function.
010     * 
011     * @author Igor Drobiazko
012     * @since 4.1
013     */
014    public class CallbackFunctionBinding extends AbstractBinding implements ICallbackFunction{
015            
016            protected CallbackFunctionBinding(String description, ValueConverter valueConverter, Location location, String value) {
017                    super(value, valueConverter, location);
018            }
019            
020            /**
021             * {@inheritDoc}
022             */
023            public Object getObject() {
024                    return getFunctionName();
025            }
026            
027            /**
028             * {@inheritDoc}
029             */
030            public String getFunctionName(){
031                    return getDescription();
032            }
033            
034            /**
035             * Returns the string representation of the object.
036             */
037        public String toString(){
038            return "CallbackFunctionBinding[" + getFunctionName() + "]";
039        }
040    
041    }