KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > ConstComponentBinder


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 11, 2005
11  *
12  * Author Ben Yu
13  * ZBS
14  */

15 package jfun.yan;
16
17 /**
18  * Zephyr Business Solution
19  *
20  * @author Ben Yu
21  *
22  */

23 final class ConstComponentBinder implements ComponentBinder {
24   private final Creator c;
25   
26   ConstComponentBinder(final Creator c) {
27     this.c = c;
28   }
29   public Creator bind(Object JavaDoc o){return c;}
30   public Verifiable verify(Class JavaDoc t){
31     return c;
32   }
33   public Class JavaDoc bindType(Class JavaDoc t){
34     return c.getType();
35   }
36   public boolean equals(Object JavaDoc obj) {
37     if(obj instanceof ConstComponentBinder){
38       final ConstComponentBinder other = (ConstComponentBinder)obj;
39       return c.equals(other.c);
40     }
41     else return false;
42   }
43   public int hashCode() {
44     return c.hashCode();
45   }
46   public String JavaDoc toString() {
47     return c.toString();
48   }
49 }
50
Popular Tags