KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ioc > depend > Dependency


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6 package org.jfox.ioc.depend;
7
8 import org.jfox.ioc.Registry;
9 import org.jfox.ioc.exception.ComponentException;
10
11 /**
12  * 用来表示构造器的参数,在依赖注射的时候将解析参数的值,
13  * 并注射到组件中。
14  *
15  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
16  */

17
18 public interface Dependency {
19
20     public static Dependency[] EMPTY_PARAMETERS = new Dependency[0];
21
22     /**
23      * 参数的 Class
24      *
25      * @return
26      */

27     Class JavaDoc getType();
28
29     /**
30      * 取得参数的字符串值。
31      * <br>
32      * {@link org.jfox.ioc.depend.ComponentRefDependency}为依赖组件的ComponentName的toString
33      * <br>
34      * {@link org.jfox.ioc.depend.ObjectDependency} 为依赖对象的toString
35      *
36      */

37     String JavaDoc getLiteralValue();
38
39     /**
40      * 解析该参数的值
41      * <br>
42      * {@link org.jfox.ioc.depend.ComponentRefDependency}为依赖组件的对象
43      * <br>
44      * {@link org.jfox.ioc.depend.ObjectDependency} 直接返回依赖对象
45      *
46      */

47     Object JavaDoc resolveValue(Registry registry) throws ComponentException;
48
49 }
Popular Tags