gpt4 book ai didi

org.onosproject.yang.compiler.linker.impl.YangLinkerUtils类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 11:31:31 27 4
gpt4 key购买 nike

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

YangLinkerUtils介绍

[英]Represent utilities for YANG linker.
[中]代表YANG linker的实用程序。

代码示例

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Detects collision between target nodes' leaf/leaf-list or child node
 * with augmented leaf/leaf-list or child node.
 *
 * @param tgt     target node
 * @param aug     YANG augment
 * @param augRoot augment's root
 */
private static void detectCollision(YangNode tgt, YangAugment aug,
                  YangNode augRoot) {
  YangNode tgtRoot = getTgtRootNode(tgt);
  String augNs = ((YangNamespace) augRoot).getModuleNamespace();
  String tgtNs = ((YangNamespace) tgtRoot).getModuleNamespace();
  if (tgt instanceof YangChoice) {
    addCaseNodeToChoiceTarget(aug);
  }
  detectCollisionInTgt(tgt, aug, augNs, tgtNs);
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Add the unresolved data under the root leve grouping to be resolved, since it will be used in interfile uses.
 *
 * @param referenceResolver module / sub-module
 */
public static void resolveGroupingInDefinationScope(YangReferenceResolver referenceResolver) {
  YangNode potentialInterFileGrouping = ((YangNode) referenceResolver).getChild();
  while (potentialInterFileGrouping != null) {
    if (potentialInterFileGrouping instanceof YangGrouping) {
      addGroupingResolvableEntitiesToResolutionList((YangGrouping) potentialInterFileGrouping);
    }
    potentialInterFileGrouping = potentialInterFileGrouping.getNextSibling();
  }
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Detects node collision of augment children nodes, leaves and leaf-lists
 * with target node's children nodes.
 *
 * @param aug YANG augment's child
 * @param tgt target node's child
 * @param aL  augment leaves
 * @param aLl augment leaf lists
 */
private static void detectNodeCollision(YangNode aug, YangNode tgt,
                    List<YangLeaf> aL,
                    List<YangLeafList> aLl) {
  while (tgt != null) {
    detectCollision(tgt.getName(), aug.getName(), aug, TARGET_NODE);
    detectLeafCollision(tgt.getName(), tgt, aL);
    detectLeafListCollision(tgt.getName(), tgt, aLl);
    tgt = tgt.getNextSibling();
  }
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Detects collision between augment's leaves and leaf lists' identifier
 * with target node leaves and leaf lists' identifier.
 *
 * @param tL  target leaves
 * @param tLl target leaf lists
 * @param aL  augment leaves
 * @param aLl augment leaf lists
 */
private static void detectLeavesCollision(List<YangLeaf> tL,
                     List<YangLeafList> tLl,
                     List<YangLeaf> aL,
                     List<YangLeafList> aLl) {
  if (aL != null && !aL.isEmpty()) {
    for (YangLeaf aLeaf : aL) {
      detectLeafCollision(aLeaf.getName(), aLeaf, tL);
      detectLeafListCollision(aLeaf.getName(), aLeaf, tLl);
    }
  }
  if (aLl != null && !aLl.isEmpty()) {
    for (YangLeafList aLeafList : aLl) {
      detectLeafCollision(aLeafList.getName(), aLeafList, tL);
      detectLeafListCollision(aLeafList.getName(), aLeafList, tLl);
    }
  }
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

detectLeavesCollision(tL, tLl, aL, aLl);
while (aChild != null) {
  detectNodeCollision(aChild, tChild, aL, aLl);
  detectLeafCollision(aChild.getName(), aChild, tL);
  detectLeafListCollision(aChild.getName(), aChild, tLl);
  aChild = aChild.getNextSibling();

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

javaCase.setName(node.getName());
traverseAndBreak(node, map);
augment.addChild(javaCase);
node.setParent(javaCase);
javaCase.addChild(node);
connectTree(map);
node.setParent(null);
traverseAndBreak(node, map);
augment.addChild(node);
node.setParent(augment);
connectTree(map);

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

if (targetNode != null) {
  if (targetNode instanceof YangAugmentableNode) {
    detectCollisionForAugment(targetNode, augment,
                 (YangNode) root);
    ((YangAugmentableNode) targetNode).addAugmentation(augment);
        (T) leafList, entityToResolveInfo.getHolderOfEntityToResolve());
  fillPathPredicates(leafRef);
} else {
  LinkerException ex = new LinkerException(

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Detects collision between augment nodes' children and target nodes'
 * nodes children and also between augment nodes' children and other
 * augmented nodes.
 *
 * @param tgt     target node
 * @param aug     YANG augment
 * @param augRoot augment's root
 */
static void detectCollisionForAugment(YangNode tgt, YangAugment aug,
                   YangNode augRoot) {
  // Detect collision for target node and augment node.
  detectCollision(tgt, aug, augRoot);
  List<YangAugment> infoList = ((YangAugmentableNode) tgt)
      .getAugmentedInfoList();
  // Detect collision for target augment node and current augment node.
  for (YangAugment info : infoList) {
    detectCollision(info, aug, augRoot);
  }
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

YangNode curNode = interFileGrouping;
TraversalType curTraversal = ROOT;
addResolvableLeavesToResolutionList((YangLeavesHolder) curNode);
curTraversal = CHILD;
curNode = interFileGrouping.getChild();
      addResolvableLeavesToResolutionList((YangLeavesHolder) curNode);
    } else if (curNode instanceof YangTypeDef) {
      List<YangType<?>> typeList = ((YangTypeDef) curNode).getTypeList();

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Detects collision with list of leaf-list name and any comparable
 * identifier.
 *
 * @param name       comparable identifier
 * @param info       location info
 * @param leavesList list of leaf-list
 */
private static void detectLeafListCollision(String name, LocationInfo info,
                      List<YangLeafList> leavesList) {
  if (leavesList != null && !leavesList.isEmpty()) {
    for (YangLeafList ll : leavesList) {
      detectCollision(ll.getName(), name, info, TGT_LEAF);
    }
  }
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

/**
 * Detects collision with list of leaf name and any comparable
 * identifier.
 *
 * @param name   comparable identifier
 * @param info   location info
 * @param leaves list of leaf
 */
private static void detectLeafCollision(String name, LocationInfo info,
                    List<YangLeaf> leaves) {
  if (leaves != null && !leaves.isEmpty()) {
    for (YangLeaf leaf : leaves) {
      detectCollision(leaf.getName(), name, info, TGT_LEAF);
    }
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com