gpt4 book ai didi

org.onosproject.yangutils.datamodel.YangLeafList类的使用及代码示例

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

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

YangLeafList介绍

[英]Represents leaf-list data represented in YANG.
[中]表示以YANG表示的叶列表数据。

代码示例

代码示例来源:origin: org.onosproject/onos-yang-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-datamodel

/**
 * Adds the list of leaf-list present under a node to resolution list,
 * after cloning. Under the cloned node, with cloned leaf-list,
 * attributes are set and added to resolution list.
 *
 * @param clonedNode cloned holder
 * @param yangUses   YANG uses
 * @throws CloneNotSupportedException clone not supported error
 * @throws DataModelException         data model error
 */
public static void cloneListOfLeafList(
    YangLeavesHolder clonedNode, YangUses yangUses)
    throws CloneNotSupportedException, DataModelException {
  List<YangLeafList> listOfLeafList = clonedNode.getListOfLeafList();
  if (nonEmpty(listOfLeafList)) {
    List<YangLeafList> clonedList = new LinkedList<>();
    for (YangLeafList leafList : listOfLeafList) {
      YangLeafList clonedLeafList = leafList.clone();
      clonedLeafList.setReferredSchemaLeafList(leafList);
      addUnresolvedType(yangUses, clonedLeafList,
               (YangNode) clonedNode);
      clonedLeafList.setContainedIn(clonedNode);
      clonedList.add(clonedLeafList);
    }
    clonedNode.setListOfLeafList(clonedList);
  }
}

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

/**
 * Creates a YANG leaf-list.
 */
public YangLeafList() {
  mustConstraintList = new LinkedList<>();
  ifFeatureList = new LinkedList<>();
  setMinElements(new YangMinElement());
  setMaxElements(new YangMaxElement());
}

代码示例来源:origin: org.onosproject/onos-yang-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-utils-parser

leafList.setName(identifier);
leafList.setLineNumber(line);
leafList.setCharPosition(charPositionInLine);
leafList.setFileName(listener.getFileName());
  leafList.setConfig(parentConfig);
  leavesHolder = (YangLeavesHolder) tmpData;
  leavesHolder.addLeafList(leafList);
  leafList.setContainedIn(leavesHolder);
} else {
  throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, LEAF_LIST_DATA,

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

try {
  ((CollisionDetector) usesParent)
      .detectCollidingChild(leafList.getName(), LEAF_LIST_DATA);
  clonedLeafList = leafList.clone();
  clonedLeafList.setReferredSchemaLeafList(leafList);
  addUnresolvedType(this, clonedLeafList,
           (YangNode) usesParent);
  throw new DataModelException(e.getMessage());
clonedLeafList.setContainedIn(usesParent);
usesParent.addLeafList(clonedLeafList);

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

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

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

if (currentListOfLeafList != null) {
  for (YangLeafList leafList : currentListOfLeafList) {
    if (leafList.getDataType().getDataType() == YangDataTypes.ENUMERATION
        || leafList.getDataType().getDataType() == YangDataTypes.UNION) {
      try {
        YangType<?> clonedType = leafList.getDataType().clone();
        updateClonedTypeRef(clonedType, leavesHolder);
        leafList.setDataType(clonedType);
      } catch (DataModelException e) {
        throw e;
        e.printStackTrace();
        throw new DataModelException("Could not clone Type node " +
            leafList.getDataType().getDataTypeName() + " in " +
            leafList.getDataType().getLineNumber() + " at " +
            leafList.getDataType().getCharPosition() +
            " in " + leafList.getDataType().getFileName() + "\"");

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

} else if (getReferredLeafOrLeafList() instanceof YangLeafList) {
  YangLeafList yangLeafList = ((YangLeafList) getReferredLeafOrLeafList());
  YangType baseType = yangLeafList.getDataType();
    YangLeafRef referredLeafRefInfo = (YangLeafRef) yangLeafList.getDataType().getDataTypeExtendedInfo();
  List<YangIfFeature> referredLeafListIfFeatureList = yangLeafList.getIfFeatureList();
  if (referredLeafListIfFeatureList != null && !referredLeafListIfFeatureList.isEmpty()) {
    Iterator<YangIfFeature> referredLeafListIfFeature = referredLeafListIfFeatureList.iterator();

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

case LEAF_LIST_DATA:
  YangLeafList leafList = (YangLeafList) tmpData;
  leafList.setMaxElements(maxElement);
  break;
case LIST_DATA:

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

case LEAF_LIST_DATA:
  YangLeafList leafList = (YangLeafList) tmpData;
  leafList.setMinElements(minElement);
  break;
case LIST_DATA:

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

case LEAF_LIST_DATA:
  YangLeafList leafList = (YangLeafList) tmpData;
  leafList.setDataType(type);

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

@Override
public void isValueValid(String value)
    throws DataModelException {
  getDataType().isValidValue(value);
}

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

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

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

/**
 * Returns types that has to be resolved for a single leaf/leaf-list.
 * Identifies the object to be leaf/leaf-list and assigns respective
 * parameters to resolve the types under leaf/leaf-list.
 *
 * @param clonedObj  leaf/leaf-list object
 * @param holderNode holder node
 * @param yangUses   YANG uses
 * @return list of resolvable entities in a leaf/leaf-list
 * @throws DataModelException data model error
 */
private static List<YangEntityToResolveInfoImpl> getTypesToBeResolved(
    Object clonedObj, YangNode holderNode,
    YangUses yangUses) throws DataModelException {
  YangType type;
  if (clonedObj instanceof YangLeaf) {
    YangLeaf clonedLeaf = (YangLeaf) clonedObj;
    type = clonedLeaf.getDataType();
    return getUnresolvedTypeList(type.getDataType(), type, holderNode,
                   yangUses, true);
  }
  YangLeafList clonedLeafList = (YangLeafList) clonedObj;
  type = clonedLeafList.getDataType();
  return getUnresolvedTypeList(type.getDataType(), type, holderNode,
                 yangUses, false);
}

代码示例来源:origin: org.onosproject/onos-yang-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-utils-parser

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

代码示例来源:origin: org.onosproject/onos-yang-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() + "\"");
    }
  }
}

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