public class ContextImpl extends BaseContextImpl implements Context, Serializable
| Constructor and Description |
|---|
ContextImpl() |
ContextImpl(Map map) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
删除上下文中的所有参数信息
|
void |
clearSubContext()
删除所有子上下文
|
Context |
contain(String name)
如果上下文存在参数名称对应的参数信息,那么返回当前实例,不存在则返回null
|
protected Context |
containNodeMap(String name,
Context contextNode,
Map<Context,String> nodeMap) |
Context |
createSubContext(String contextName)
创建子上下文
|
boolean |
exist(String name)
检测参数是否存在
|
protected boolean |
existNodeMap(String name,
Context contextNode,
Map<Context,String> nodeMap) |
protected <T> T |
findNodeMap(String name,
Context contextNode,
Map<Context,String> nodeMap) |
<T> T |
get(String name)
改写get方法,使得可以从父环境中查找,同时,也可以从子环境中查找 先找自己,再找子,再找父
|
<T> T |
getInSubContext(String contextName,
String name)
从指定子环境获取变量
|
Map<String,Object> |
getItemMap()
返回上下文中所有参数
|
Context |
getParent()
返回父上下文对象
|
Context |
getSubContext(String contextName)
返回子环境
|
Map<String,Context> |
getSubContextMap()
返回所有子上下文组装成的map
|
protected void |
getTotalContext(Context contextNode,
List<Context> list) |
Map<String,Object> |
getTotalItemMap()
返回上下文(包含子上下文)中所有内容
3.4.8.5(不包含)及以后的版本中,
返回上下文(包含父子上下文)中所有内容
|
<T> T |
put(String contextName,
String name,
T object)
添加到子环境
|
void |
putContext(String contextName,
Context context)
设置儿子环境,但儿子的不设置当前为父亲
|
Context |
putSubContext(String contextName,
Context context)
添加子环境
|
<T> T |
remove(String contextName,
String name)
从子上下文中删除name的参数信息
|
Context |
removeSubContext(String contextName)
删除子上下文
|
boolean |
renameKey(String key,
String newKey)
把环境中某键值的名字换成另外的名字
|
protected boolean |
renameKeyNodeMap(String key,
String newKey,
Context contextNode,
Map<Context,String> nodeMap) |
void |
setParent(Context parent)
设置父上下文对象
|
get, put, putAll, remove, setItemMap, sizepublic ContextImpl()
public ContextImpl(Map map)
public Context createSubContext(String contextName)
ContextcreateSubContext in interface ContextcontextName - 上下文名称public Context putSubContext(String contextName, Context context)
ContextputSubContext in interface ContextcontextName - 子环境public Context removeSubContext(String contextName)
ContextremoveSubContext in interface ContextcontextName - 子环境public Context getSubContext(String contextName)
ContextgetSubContext in interface ContextcontextName - 子环境public void clearSubContext()
ContextclearSubContext in interface Contextpublic void clear()
BaseContextclear in interface BaseContextclear in class BaseContextImplpublic Map<String,Context> getSubContextMap()
ContextgetSubContextMap in interface Contextpublic <T> T remove(String contextName, String name)
Contextpublic <T> T getInSubContext(String contextName, String name)
ContextgetInSubContext in interface ContextcontextName - 子环境name - 上下文变量名称public <T> T put(String contextName, String name, T object)
Contextpublic <T> T get(String name)
get in interface BaseContextget in class BaseContextImplname - 参数名称public Map<String,Object> getTotalItemMap()
ContextgetTotalItemMap in interface Contextprotected <T> T findNodeMap(String name, Context contextNode, Map<Context,String> nodeMap)
protected boolean existNodeMap(String name, Context contextNode, Map<Context,String> nodeMap)
protected Context containNodeMap(String name, Context contextNode, Map<Context,String> nodeMap)
public boolean renameKey(String key, String newKey)
BaseContextrenameKey in interface BaseContextrenameKey in class BaseContextImplkey - 旧的参数名称newKey - 新的参数名称protected boolean renameKeyNodeMap(String key, String newKey, Context contextNode, Map<Context,String> nodeMap)
public boolean exist(String name)
BaseContextexist in interface BaseContextexist in class BaseContextImplname - 参数名称public Context contain(String name)
BaseContextcontain in interface BaseContextcontain in class BaseContextImplname - 参数名称public Map<String,Object> getItemMap()
BaseContextgetItemMap in interface BaseContextgetItemMap in interface ContextgetItemMap in class BaseContextImplCopyright © 2006–2018 TinyGroup. All rights reserved.