public abstract class AbstractApplicationContext extends Object implements ApplicationContext
| 限定符和类型 | 字段和说明 |
|---|---|
protected List<BeanDefinition> |
beanDefinitions |
protected Set<String> |
errorMemo |
protected Map<String,Object> |
map |
| 构造器和说明 |
|---|
AbstractApplicationContext() |
AbstractApplicationContext(String file) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
addObjectToContext(BeanDefinition beanDefinition,
Object object) |
protected void |
check()
Conflicts check 1.More than two components have the same id 2.The one of
two components that have the same class name or interface name dosen't
set id. 3.Two components have the same class name or interface name and
different id, save memo.
|
protected void |
check(String key) |
protected void |
error(String msg) |
protected BeanDefinition |
findBeanDefinition(String key) |
<T> T |
getBean(Class<T> clazz) |
<T> T |
getBean(String id) |
protected abstract List<BeanDefinition> |
getBeanDefinitions(String file) |
protected abstract Object |
inject(BeanDefinition beanDef) |
protected List<BeanDefinition> beanDefinitions
public AbstractApplicationContext()
public AbstractApplicationContext(String file)
public <T> T getBean(Class<T> clazz)
getBean 在接口中 ApplicationContextpublic <T> T getBean(String id)
getBean 在接口中 ApplicationContextprotected void check()
protected void check(String key)
protected void addObjectToContext(BeanDefinition beanDefinition, Object object)
protected BeanDefinition findBeanDefinition(String key)
protected void error(String msg)
protected abstract List<BeanDefinition> getBeanDefinitions(String file)
protected abstract Object inject(BeanDefinition beanDef)
Copyright © 2016. All rights reserved.