gpt4 book ai didi

org.onosproject.yang.compiler.datamodel.YangLeafList.getName()方法的使用及代码示例

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

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

YangLeafList.getName介绍

[英]Retrieve the name of leaf list.
[中]检索叶列表的名称。

代码示例

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

@Override
public SchemaId getSchemaId() {
  SchemaId schemaId = new SchemaId(
      this.getName(), this.getNameSpace().getModuleNamespace());
  return schemaId;
}

代码示例来源: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

/**
 * Returns the leaf-list by searching it in the node by the leaf-list name.
 * Returns null when the name doesn't match.
 *
 * @param name   leaf-list name
 * @param holder holder of leaf-list
 * @return YANG leaf-list
 */
private static YangLeafList getLeafList(YangNodeIdentifier name,
                    YangLeavesHolder holder) {
  List<YangLeafList> listOfLeafList = holder.getListOfLeafList();
  if (listOfLeafList != null) {
    for (YangLeafList yangLeafList : listOfLeafList) {
      if (yangLeafList.getName().equals(name.getName())) {
        return yangLeafList;
      }
    }
  }
  return null;
}

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

/**
 * Sets leaf namespace and add itself to parent child schema map.
 *
 * @param nameSpace namespace
 */
public void setLeafNameSpaceAndAddToParentSchemaMap(YangNamespace nameSpace) {
  setNameSpace(nameSpace);
  // Process addition of leaf to schema node map.
  ((YangNode) getContainedIn()).processAdditionOfSchemaNodeToCurNodeMap(getName(), getNameSpace(), this);
}

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

/**
 * Detects the colliding identifier name in a given leaf-list node.
 *
 * @param listOfLeafList list of leaf-lists to detect collision
 * @param identifierName name for which collision detection is to be checked
 * @throws DataModelException a violation of data model rules
 */
private static void detectCollidingLeafList(List<YangLeafList> listOfLeafList, String identifierName)
    throws DataModelException {
  if (listOfLeafList == null) {
    return;
  }
  for (YangLeafList leafList : listOfLeafList) {
    if (leafList.getName().equals(identifierName)) {
      throw new DataModelException("YANG file error: Duplicate input identifier detected, same as leaf " +
                         "list \"" + leafList.getName() + " in " +
                         leafList.getLineNumber() + " at " +
                         leafList.getCharPosition() +
                         " in " + leafList.getFileName() + "\"");
    }
  }
}

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

/**
 * Searches for leaf/leaf-list in given leaf holder node.
 *
 * @param target leaf holder
 * @param name   leaf/leaf-list name
 * @return leaf/leaf-list node
 */
public static YangSchemaNode findLeafNode(YangLeavesHolder target,
                     String name) {
  List<YangLeaf> leaves = target.getListOfLeaf();
  if (leaves != null && !leaves.isEmpty()) {
    for (YangLeaf leaf : leaves) {
      if (leaf.getName().equals(name)) {
        return leaf;
      }
    }
  }
  List<YangLeafList> listOfleafList = target.getListOfLeafList();
  if (listOfleafList != null && !listOfleafList.isEmpty()) {
    for (YangLeafList leafList : listOfleafList) {
      if (leafList.getName().equals(name)) {
        return leafList;
      }
    }
  }
  return null;
}

代码示例来源: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-datamodel

/**
 * Removes leaf/leaf-list from data model tree.
 *
 * @param node     YANG data model node
 * @param leafName name of leaf to be removed
 */
public static void deleteUnsupportedLeafOrLeafList(YangLeavesHolder node,
                          String leafName) {
  List<YangLeaf> leaves = node.getListOfLeaf();
  if (leaves != null && !leaves.isEmpty()) {
    for (YangLeaf leaf : leaves) {
      if (leaf.getName().equals(leafName)) {
        node.removeLeaf(leaf);
        return;
      }
    }
  }
  List<YangLeafList> leafList = node.getListOfLeafList();
  if (leafList != null && !leafList.isEmpty()) {
    for (YangLeafList leaf : leafList) {
      if (leaf.getName().equals(leafName)) {
        node.removeLeafList(leaf);
        return;
      }
    }
  }
}

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

/**
 * Searches target leaf in root node.
 *
 * @param node      root node
 * @param curNodeId YANG node identifier
 * @return linked target leaf node holder
 */
private YangNode searchTargetLeaf(YangNode node,
                 YangNodeIdentifier curNodeId) {
  YangLeavesHolder holder = (YangLeavesHolder) node;
  List<YangLeafList> leavesList = holder.getListOfLeafList();
  if (leavesList != null && !leavesList.isEmpty()) {
    for (YangLeafList leafList : leavesList) {
      if (leafList.getName().equals(curNodeId.getName())) {
        return node;
      }
    }
  }
  List<YangLeaf> leaves = holder.getListOfLeaf();
  if (leaves != null && !leaves.isEmpty()) {
    for (YangLeaf leaf : leaves) {
      if (leaf.getName().equals(curNodeId.getName())) {
        return node;
      }
    }
  }
  return null;
}

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

@Override
public YangSchemaNodeContextInfo getChildSchema(
    YangSchemaNodeIdentifier dataNodeIdentifier)
    throws DataModelException {
  throw new DataModelException("leaf cannot have any child schema nodes" +
                     getName() + " in " +
                     getLineNumber() + " at " +
                     getCharPosition() +
                     " in " + getFileName() + "\"");
}

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

@Override
public int getMandatoryChildCount()
    throws DataModelException {
  throw new DataModelException("leaf list can't have child " + getName() + " in " +
                     getLineNumber() + " at " +
                     getCharPosition() +
                     " in " + getFileName() + "\"");
}

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

/**
 * Searches for the referred leaf-list in target node.
 *
 * @param targetNode target node
 * @param name       leaf-list name
 * @return target leaf-list
 */
private YangLeafList searchReferredLeafList(YangNode targetNode, String name) {
  if (!(targetNode instanceof YangLeavesHolder)) {
    throw new LinkerException(getErrorMsg(
        LEAF_HOLDER_ERROR, targetNode.getName(), targetNode
            .getLineNumber(), targetNode.getCharPosition(),
        targetNode.getFileName()));
  }
  YangLeavesHolder holder = (YangLeavesHolder) targetNode;
  List<YangLeafList> leavesList = holder.getListOfLeafList();
  if (leavesList != null && !leavesList.isEmpty()) {
    for (YangLeafList leafList : leavesList) {
      if (leafList.getName().equals(name)) {
        return leafList;
      }
    }
  }
  return null;
}

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

break;
case LEAF_LIST_DATA:
  bitsNode.setBitsName(((YangLeafList) tmpData).getName());
  break;
case TYPEDEF_DATA:

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

case LEAF_LIST_DATA:
  unionNode.setName(((YangLeafList) tmpData).getName() + UNION_CLASS_SUFFIX);

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

case LEAF_LIST_DATA:
  enumerationNode.setName(((YangLeafList) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);

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

for (YangLeafList leafList : augment.getListOfLeafList()) {
  YangCase javaCase = getYangCaseNode(JAVA_GENERATION);
  javaCase.setName(leafList.getName());
  javaCase.addLeafList(leafList);
  augment.addChild(javaCase);

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

try {
  ((CollisionDetector) destLeafHolder)
      .detectCollidingChild(leafList.getName(), LEAF_LIST_DATA);
  clonedLeafList = leafList.cloneForDeviation();
  clonedLeafList.setReferredSchemaLeafList(leafList);

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

try {
  ((CollisionDetector) usesParent)
      .detectCollidingChild(leafList.getName(), LEAF_LIST_DATA);
  clonedLeafList = leafList.clone();
  clonedLeafList.setReferredSchemaLeafList(leafList);

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