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

x33g5p2x  于2022-02-05 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(88)

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

YangSubModule介绍

[英]Represents data model node to maintain information defined in YANG sub-module.
[中]表示数据模型节点,用于维护子模块中定义的信息。

代码示例

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

@Override
public void addReferencesToIncludeList(Set<YangNode> yangNodeSet)
    throws DataModelException {
  // Run through the included list to add references.
  for (YangInclude yangInclude : getIncludeList()) {
    YangSubModule subModule = yangInclude.addReferenceToInclude(yangNodeSet);
    // Check if the referred sub-modules parent is self
    if (!Objects.equals(subModule.getBelongsTo().getModuleNode(), getBelongsTo()
        .getModuleNode())) {
      yangInclude.reportIncludeError();
    }
  }
}

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

@Override
public void addReferencesToImportList(Set<YangNode> yangNodeSet)
    throws DataModelException {
  // Run through the imported list to add references.
  for (YangImport yangImport : getImportList()) {
    yangImport.addReferenceToImport(yangNodeSet);
  }
}

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

@Override
public void resolveSelfFileLinking(ResolvableType type)
    throws DataModelException {
  // Get the list to be resolved.
  List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(type);
  // Resolve linking for a resolution list.
  resolveLinkingForResolutionList(resolutionList, this);
}

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

@Override
public void setLeafNameSpaceAndAddToParentSchemaMap() {
  // Add namespace for all leafs.
  for (YangLeaf yangLeaf : getListOfLeaf()) {
    yangLeaf.setLeafNameSpaceAndAddToParentSchemaMap(getNameSpace());
  }
  // Add namespace for all leaf list.
  for (YangLeafList yangLeafList : getListOfLeafList()) {
    yangLeafList.setLeafNameSpaceAndAddToParentSchemaMap(getNameSpace());
  }
}

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

case SUB_MODULE_DATA: {
  YangSubModule subModule = (YangSubModule) tmpNode;
  subModule.setBelongsTo((YangBelongsTo) tmpBelongstoNode);
  subModule.setPrefix(subModule.getBelongsTo().getPrefix());
  break;

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

if (subModule.getUnresolvedResolutionList(ResolvableType.YANG_COMPILER_ANNOTATION) != null
    && subModule.getUnresolvedResolutionList(ResolvableType.YANG_COMPILER_ANNOTATION).size() != 0
    && subModule.getChild() != null) {
  throw new ParserException(constructListenerErrorMessage(INVALID_CHILD, MODULE_DATA,
                              ctx.identifier().getText(), EXIT));

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

@Override
public void addReferencesToIncludeList(Set<YangNode> yangNodeSet)
    throws DataModelException {
  // Run through the included list to add references.
  for (YangInclude yangInclude : getIncludeList()) {
    YangSubModule subModule = yangInclude
        .addReferenceToInclude(yangNodeSet);
    // Check if the referred sub-modules parent is self
    if (!subModule.getBelongsTo().getModuleNode().equals(this)) {
      yangInclude.reportIncludeError();
    }
  }
}

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

subModule.addToImportList((YangImport) tmpImportNode);
break;

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

subModule.addToIncludeList((YangInclude) tmpIncludeNode);
break;

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

case SUB_MODULE_DATA:
  YangSubModule subModule = ((YangSubModule) curData);
  subModule.addExtension(extension);
  break;
default:

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

@Override
public void resolveInterFileLinking(ResolvableType type)
    throws DataModelException {
  // Get the list to be resolved.
  List<YangResolutionInfo> resolutionList = getUnresolvedResolutionList(type);
  // Resolve linking for a resolution list.
  linkInterFileReferences(resolutionList, this);
}

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

/**
 * Validates the prefix of the YANG file where leaf-ref is present and
 * puts it in the map of node and prefix in leaf-ref.
 *
 * @param atomicList atomic content list in leaf-ref
 * @param leafRef    YANG leaf-ref
 */
private static void valPrefix(List<YangAtomicPath> atomicList,
               YangLeafRef leafRef) {
  for (YangAtomicPath atomicPath : atomicList) {
    String prefix = atomicPath.getNodeIdentifier().getPrefix();
    YangNode parent = leafRef.getParentNode();
    YangNode rootNode = getRootNode(parent);
    List<YangImport> imports;
    if (rootNode instanceof YangModule) {
      imports = ((YangModule) rootNode).getImportList();
    } else {
      imports = ((YangSubModule) rootNode).getImportList();
    }
    updatePrefixWithNode(rootNode, imports, prefix, leafRef);
  }
}

相关文章

YangSubModule类方法