gpt4 book ai didi

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

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

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

YangLeafRef.setParentNode介绍

[英]Sets the parent node from the leafref's leaf.
[中]从leafref的叶设置父节点。

代码示例

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

/**
 * Returns resolvable entity when the type is leaf-ref. It changes the
 * prefixes from grouping to uses, then changes the parent node to the
 * cloned node, sets needed information to entity such as line number,
 * position number and holder.
 *
 * @param type     YANG type of leaf-ref
 * @param yangUses YANG uses
 * @param holder   cloned holder
 * @return entity to resolve for leaf-ref
 * @throws DataModelException data model error
 */
private static YangEntityToResolveInfoImpl getLeafRefResolvableEntity(
    YangType type, YangUses yangUses, YangNode holder)
    throws DataModelException {
  YangEntityToResolveInfoImpl<YangLeafRef> leafRefInfo =
      new YangEntityToResolveInfoImpl<>();
  YangLeafRef leafRef = (YangLeafRef) type.getDataTypeExtendedInfo();
  // Conversion of prefixes in absolute path while cloning them.
  convertThePrefixesDuringChange(leafRef, yangUses);
  leafRef.setParentNode(holder);
  leafRefInfo.setEntityToResolve(leafRef);
  return setInformationInEntity(
      leafRefInfo, holder, leafRef.getCharPosition(),
      leafRef.getLineNumber());
}

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

leafRef.setParentNode((YangNode) parentNodeOfLeaf);
if (listener.getGroupingDepth() == 0) {
leafRef.setParentNode((YangNode) parentNodeOfLeafList);
leafRef.setParentNode((YangNode) parentNodeOfLeafref);
if (listener.getGroupingDepth() != 0) {
  leafRef.setInGrouping(true);

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

/**
 * Adds resolvable type (leaf-ref) info to resolution list.
 *
 * @param extType resolvable type
 * @param type    YANG type
 * @param holder  holder node
 * @throws DataModelException if there is a data model error
 */
private void addRefTypeInfo(T extType, YangType<T> type, YangNode holder)
    throws DataModelException {
  type.resetYangType();
  type.setResolvableStatus(RESOLVED);
  type.setDataType(YangDataTypes.LEAFREF);
  type.setDataTypeName(LEAFREF);
  type.setDataTypeExtendedInfo(extType);
  YangLeafRef leafRef = (YangLeafRef) extType;
  (leafRef).setResolvableStatus(UNRESOLVED);
  leafRef.setParentNode(holder);
  YangResolutionInfoImpl info = new YangResolutionInfoImpl<>(
      leafRef, holder, getLineNumber(), getCharPosition());
  curRefResolver.addToResolutionList(info, YANG_LEAFREF);
  curRefResolver.resolveSelfFileLinking(YANG_LEAFREF);
}

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

/**
 * Adds the unresolved entities to the resolution list.
 *
 * @param entityToResolve entity to resolve
 * @throws DataModelException a violation of data model rules
 */
private void addUnresolvedEntitiesToResolutionList(T entityToResolve)
    throws DataModelException {
  if (entityToResolve instanceof YangEntityToResolveInfoImpl) {
    YangEntityToResolveInfoImpl entityToResolveInfo
        = (YangEntityToResolveInfoImpl) entityToResolve;
    if (entityToResolveInfo.getEntityToResolve() instanceof YangLeafRef) {
      YangLeafRef leafref = (YangLeafRef) entityToResolveInfo
          .getEntityToResolve();
      YangNode parentNodeOfLeafref = entityToResolveInfo
          .getHolderOfEntityToResolve();
      leafref.setParentNode(parentNodeOfLeafref);
      if (leafref.getResolvableStatus() == UNRESOLVED) {
        leafref.setResolvableStatus(INTRA_FILE_RESOLVED);
      }
    }
    // Add resolution information to the list.
    YangResolutionInfoImpl resolutionInfoImpl = new YangResolutionInfoImpl<>(
        entityToResolveInfo.getEntityToResolve(),
        entityToResolveInfo.getHolderOfEntityToResolve(),
        entityToResolveInfo.getLineNumber(),
        entityToResolveInfo.getCharPosition());
    addResolutionInfo(resolutionInfoImpl);
  }
}

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