gpt4 book ai didi

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

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

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

YangUnion介绍

[英]Represents data model node to maintain information defined in YANG union.
[中]表示数据模型节点,以维护在联合中定义的信息。

代码示例

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

Parsable typeData = listener.getParsedDataStack().pop();
unionNode.setLineNumber(ctx.getStart().getLine());
unionNode.setCharPosition(ctx.getStart().getCharPositionInLine());
unionNode.setFileName(listener.getFileName());
  case LEAF_DATA:
    unionNode.setName(((YangLeaf) tmpData).getName() + UNION_CLASS_SUFFIX);
  case LEAF_LIST_DATA:
    unionNode.setName(((YangLeafList) tmpData).getName() + UNION_CLASS_SUFFIX);
    unionNode.setName(parentUnion.getName() + UNION_CLASS_SUFFIX + parentUnion.getChildUnionNumber());
    parentUnion.setChildUnionNumber(parentUnion.getChildUnionNumber() + 1);
    YangTypeDef typeDef = (YangTypeDef) tmpData;
    unionNode.setName(typeDef.getName() + UNION_CLASS_SUFFIX);

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

/**
 * Adds YANG type to type list.
 *
 * @param yangType YANG type to be added to list
 * @throws DataModelException union member type must not be one of the
 *                            built-in types "empty" or "leafref"
 */
public void addType(YangType<?> yangType)
    throws DataModelException {
  YangDataTypes type = yangType.getDataType();
  String msg = "Union member type must not be one of the built-in types" +
      " \"empty\" or \"leafref\"";
  switch (type) {
    case EMPTY:
    case LEAFREF:
      throw new DataModelException(getErrorMsg(
          msg, getName(), getLineNumber(), getCharPosition(),
          getFileName()));
    default:
      typeList.add(yangType);
  }
}

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

/**
 * Returns resolvable entity under union. When types under union have
 * identity-ref, derived and union, the function call is done recursively
 * to get resolvable entity and adds it to list.
 *
 * @param type   union YANG type
 * @param isLeaf leaf or leaf-list
 * @return resolvable entity list after setting info
 * @throws DataModelException data model error
 */
private static List<YangEntityToResolveInfoImpl> getUnionResolvableEntity(
    YangType type, boolean isLeaf) throws DataModelException {
  YangUnion union = (YangUnion) type.getDataTypeExtendedInfo();
  List<YangType<?>> typeList = union.getTypeList();
  List<YangEntityToResolveInfoImpl> unionList = new ArrayList<>();
  List<YangEntityToResolveInfoImpl> entity;
  for (YangType unionType : typeList) {
    entity = getUnresolvedTypeList(unionType.getDataType(),
                    unionType, union, null, isLeaf);
    if (nonEmpty(entity)) {
      unionList.addAll(entity);
    }
  }
  return unionList;
}

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

enumerationNode.setName(yangUnion.getName() + ENUMERATION_CLASS_SUFFIX
    + yangUnion.getChildUnionNumber());
yangUnion.setChildUnionNumber(yangUnion.getChildUnionNumber() + 1);

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

break;
case UNION_DATA:
  bitsNode.setBitsName(((YangUnion) tmpData).getName());
  break;

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

YangUnion unionNode = (YangUnion) tmpData;
try {
  unionNode.addType(type);
} catch (DataModelException e) {
  ParserException parserException = new ParserException(e.getMessage());

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

} else if (dataType.getDataType() == YangDataTypes.UNION) {
  YangUnion unionNode = (YangUnion) dataType.getDataTypeExtendedInfo();
  dataTypeName = unionNode.getName();

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

.getTypeList().contains(EMPTY);
default:
  return dataType.getDataType().equals(EMPTY);

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

ListIterator<YangType<?>> listIterator = ((YangUnion) getDataTypeExtendedInfo()).getTypeList()
    .listIterator();
boolean isValidated = false;

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