org.tinygroup.context.Context.getSubContextMap()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(194)

本文整理了Java中org.tinygroup.context.Context.getSubContextMap()方法的一些代码示例,展示了Context.getSubContextMap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getSubContextMap()方法的具体详情如下:
包路径:org.tinygroup.context.Context
类名称:Context
方法名:getSubContextMap

Context.getSubContextMap介绍

[英]返回所有子上下文组装成的map
[中]返回所有子上下文组装成的地图

代码示例

代码示例来源:origin: org.tinygroup/org.tinygroup.beancontext

public Map<String, Context> getSubContextMap() {
  return context.getSubContextMap();
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context

protected boolean renameKeyNodeMap(String key, String newKey,
                  Context contextNode, Map<Context, String> nodeMap) {
  boolean renamed = renameKeyOfSuper(key, newKey, contextNode);
  Context theParent = contextNode.getParent();
  if (renamed) {
    return true;
  } else {
    nodeMap.put(contextNode, "");
  }
  if (!contextNode.getSubContextMap().isEmpty()) {
    for (Context context : contextNode.getSubContextMap().values()) {
      if (nodeMap.get(context) == null) {
        renamed = renameKeyNodeMap(key, newKey, context, nodeMap);
        if (renamed) {
          return true;
        }
      }
    }
  }
  if (theParent != null && nodeMap.get(theParent) == null) {
    renamed = renameKeyNodeMap(key, newKey, theParent, nodeMap);
    if (renamed) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context

protected boolean existNodeMap(String name, Context contextNode,
                Map<Context, String> nodeMap) {
  // 如果当前不存在,则查找父亲中有没有
  // 如果已经存在,则返回之
  if (contextNode.getItemMap().containsKey(name)) {
    return true;
  } else {
    nodeMap.put(contextNode, "");
  }
  if (!contextNode.getSubContextMap().isEmpty()) {
    for (Context context : contextNode.getSubContextMap().values()) {
      if (nodeMap.get(context) == null) {
        boolean exist = existNodeMap(name, context, nodeMap);
        if (exist) {
          return true;
        }
      }
    }
  }
  Context theParent = contextNode.getParent();
  if (theParent != null && nodeMap.get(theParent) == null) {
    return existNodeMap(name, theParent, nodeMap);
  }
  return false;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context

protected Context containNodeMap(String name, Context contextNode,
                 Map<Context, String> nodeMap) {
  // 如果当前不存在,则查找父亲中有没有
  // 如果已经存在,则返回之
  if (contextNode.getItemMap().containsKey(name)) {
    return contextNode;
  } else {
    nodeMap.put(contextNode, "");
  }
  if (!contextNode.getSubContextMap().isEmpty()) {
    for (Context context : contextNode.getSubContextMap().values()) {
      if (nodeMap.get(context) == null) {
        Context con = containNodeMap(name, context, nodeMap);
        if (con != null) {
          return con;
        }
      }
    }
  }
  Context theParent = contextNode.getParent();
  if (theParent != null && nodeMap.get(theParent) == null) {
    return containNodeMap(name, theParent, nodeMap);
  }
  return null;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context

protected  void getTotalContext(Context contextNode, List<Context> list){
  if(!list.contains(contextNode)){
    list.add(contextNode);
  }else{
    return;
  }
  for (Context subContext : contextNode.getSubContextMap().values()) {
    getTotalContext(subContext,list);
  }
  if(contextNode.getParent()!=null){
    getTotalContext(contextNode.getParent(),list);
  }
}

代码示例来源:origin: org.tinygroup/context

protected boolean renameKeyNodeMap(String key, String newKey,
    Context contextNode, Map<Context, String> nodeMap) {
  boolean renamed = renameKeyOfSuper(key, newKey, contextNode);
  Context theParent = contextNode.getParent();
  if (renamed) {
    return true;
  } else {
    nodeMap.put(contextNode, "");
  }
  if (contextNode.getSubContextMap().size() > 0) {
    for (Context context : contextNode.getSubContextMap().values()) {
      if (nodeMap.get(context) == null) {
        renamed = renameKeyNodeMap(key, newKey, context, nodeMap);
        if (renamed) {
          return true;
        }
      }
    }
  }
  if (theParent != null && nodeMap.get(theParent) == null) {
    renamed = renameKeyNodeMap(key, newKey, theParent, nodeMap);
    if (renamed) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context

nodeMap.put(contextNode, "");
if (!contextNode.getSubContextMap().isEmpty()) {
  for (Context context : contextNode.getSubContextMap().values()) {
    if (nodeMap.get(context) == null) {
      T subResult = findNodeMap(name, context, nodeMap);

代码示例来源:origin: org.tinygroup/context

nodeMap.put(contextNode, "");
if (contextNode.getSubContextMap().size() > 0) {
  for (Context context : contextNode.getSubContextMap().values()) {
    if (nodeMap.get(context) == null) {
      T subResult = (T) findNodeMap(name, context, nodeMap);

相关文章