KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > BeanPropertyComponentBinder


1 /*****************************************************************************
2  * Copyright (C) Zephyr Business Solution. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8
9 /*
10  * Created on Apr 22, 2005
11  *
12  * Author Ben Yu
13  * ZBS
14  */

15 package jfun.yan;
16
17 import jfun.yan.function.Function;
18
19 /**
20  * Common implementation of ComponentBinder
21  * that uses a Function to do the work.
22  * <p>
23  * Zephyr Business Solution
24  *
25  * @author Ben Yu
26  *
27  */

28 abstract class BeanPropertyComponentBinder implements ComponentBinder {
29   abstract Function toFunction(Object JavaDoc v);
30   public Class JavaDoc bindType(Class JavaDoc type) {
31     return toFunction(null).getReturnType();
32   }
33   public Verifiable verify(Class JavaDoc type) {
34     return Components.fun(toFunction(null));
35   }
36   public Creator bind(Object JavaDoc v) throws Throwable JavaDoc {
37     return Components.fun(toFunction(v));
38   }
39   public String JavaDoc toString(){
40     return toFunction(null).toString();
41   }
42 }
43
Popular Tags