gpt4 book ai didi

org.onosproject.yang.compiler.datamodel.YangIdentityRef类的使用及代码示例

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

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

YangIdentityRef介绍

[英]Represents data model node to maintain information defined in YANG identityref.
[中]表示数据模型节点,以维护标识引用中定义的信息。

代码示例

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

@Override
public Object resolve()
    throws DataModelException {
  // Check if the derived info is present.
  YangIdentity identity = getReferredIdentity();
  if (identity == null) {
    throw new DataModelException("Linker Error: Identity information is missing. " +
        getName() + " in " +
        getLineNumber() + " at " +
        getCharPosition() +
        " in " + getFileName() + "\"");
  }
  while (identity.getBaseNode() != null) {
    if (identity.getBaseNode().getResolvableStatus() != RESOLVED) {
      setResolvableStatus(INTRA_FILE_RESOLVED);
      return null;
    }
    identity = identity.getBaseNode().getReferredIdentity();
  }
  return null;
}

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

/**
 * Finds the referred identity node at the root level of imported/included node.
 *
 * @param refNode module/sub-module node
 * @return referred identity
 */
private YangNode findRefIdentityRef(YangNode refNode) {
  YangNode tmpNode = refNode.getChild();
  while (tmpNode != null) {
    if (tmpNode instanceof YangIdentity) {
      if (tmpNode.getName()
          .equals(((YangIdentityRef) getCurEntityToResolveFromStack())
                  .getBaseIdentity().getName())) {
        return tmpNode;
      }
    }
    tmpNode = tmpNode.getNextSibling();
  }
  return null;
}

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

YangIdentityRef idRef = new YangIdentityRef();
Parsable typeData = listener.getParsedDataStack().pop();
YangResolutionInfoImpl<YangIdentityRef> resolutionInfo;
idRef.setBaseIdentity(nodeId);
((YangType) typeData).setDataTypeExtendedInfo(idRef);
int errPos = ctx.getStart().getCharPositionInLine();
idRef.setLineNumber(errLine);
idRef.setCharPosition(errPos);
idRef.setFileName(listener.getFileName());
                     ctx.getText(), EXIT));
idRef.setResolvableStatus(UNRESOLVED);

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

YangIdentityRef identityRef = (YangIdentityRef) type.getDataTypeExtendedInfo();
identityRef.setIdentityForInterFileGroupingResolution(true);
                          identityRef.getLineNumber(),
                          identityRef.getCharPosition());
try {
  addResolutionInfo(resolutionInfo);
YangIdentityRef identityRef = (YangIdentityRef) type.getDataTypeExtendedInfo();
identityRef.setIdentityForInterFileGroupingResolution(true);
                          identityRef.getLineNumber(),
                          identityRef.getCharPosition());
try {
  addResolutionInfo(resolutionInfo);

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

/**
 * Returns referred typedef/grouping node.
 *
 * @return referred typedef/grouping node
 * @throws DataModelException a violation in data model rule
 */
private T getRefNode() throws DataModelException {
  T entity = getCurEntityToResolveFromStack();
  if (entity instanceof YangType) {
    YangDerivedInfo<?> derivedInfo = (YangDerivedInfo<?>)
        ((YangType<?>) entity).getDataTypeExtendedInfo();
    return (T) derivedInfo.getReferredTypeDef();
  }
  if (entity instanceof YangUses) {
    return (T) ((YangUses) entity).getRefGroup();
  }
  if (entity instanceof YangIfFeature) {
    return (T) ((YangIfFeature) entity).getReferredFeatureHolder();
  }
  if (entity instanceof YangLeafRef) {
    return (T) ((YangLeafRef) entity).getReferredLeafOrLeafList();
  }
  if (entity instanceof YangBase) {
    return (T) ((YangBase) entity).getReferredIdentity();
  }
  if (entity instanceof YangIdentityRef) {
    return (T) ((YangIdentityRef) entity).getReferredIdentity();
  }
  throw new DataModelException(LINKER_ERROR);
}

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

T entity = getCurEntityToResolveFromStack();
if (entity instanceof YangIdentityRef) {
  nodeName = ((YangIdentityRef) entity).getName();
} else if (entity instanceof YangBase) {
  nodeName = ((YangBase) entity).getBaseIdentifier().getName();

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

/**
 * Returns the referenced prefix of entity under resolution.
 *
 * @return referenced prefix of entity under resolution
 * @throws DataModelException a violation in data model rule
 */
private String getRefPrefix()
    throws DataModelException {
  T entity = getCurEntityToResolveFromStack();
  if (entity instanceof YangType) {
    return ((YangType<?>) entity).getPrefix();
  }
  if (entity instanceof YangUses) {
    return ((YangUses) entity).getPrefix();
  }
  if (entity instanceof YangIfFeature) {
    return ((YangIfFeature) entity).getPrefix();
  }
  if (entity instanceof YangBase) {
    return ((YangBase) entity).getBaseIdentifier()
        .getPrefix();
  }
  if (entity instanceof YangIdentityRef) {
    return ((YangIdentityRef) entity).getPrefix();
  }
  throw new DataModelException(LINKER_ERROR);
}

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

case IDENTITYREF:
  YangIdentity refId = ((YangIdentityRef) typeInfo
      .getDataTypeExtendedInfo()).getReferredIdentity();
  return getReferIdNamespace(refId, v);
case LEAFREF:

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

.getName());

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