container.java

来自「类似struts2的mvc框架」· Java 代码 · 共 60 行

JAVA
60
字号
/** *  Pxb IOC. *  Copyright 2008 Panxiaobo. *  All rights reserved. *  $Id: Container.java 35 2008-08-18 11:10:07Z Panxiaobo $ */package pxb.ioc;/** * The ioc Container, use this to inject a class or an instance. it is similar * to guice *  * @author Panxiaobo [pxb1988@126.com] */@ImplementedBy("pxb.ioc.impl.DefaultContainer")public interface Container{	/**	 * the default Inject value . (at)Inject() == (at)Inject("default")	 */	public String	DEFAULT_NAME	= "default";	/**	 * Inject(create) an instance of the type	 * 	 * @see inject(type,"default")	 * @param <T>	 * @param type	 *            the type	 * @return the instance	 * @throws Exception	 */	public <T> T inject(Class<T> type) throws Exception;	/**	 * Inject(create) an instance of the type and the name	 * 	 * @param <T>	 * @param type	 *            the type	 * @param name	 *            the name	 * @return the instance	 * @throws Exception	 */	public <T> T inject(Class<T> type, String name) throws Exception;	/**	 * Inject an instance	 * 	 * @param <T>	 * @param t	 *            the Instance	 * @return the Injected instance	 * @throws Exception	 */	public <T> T inject(T t) throws Exception;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?