gpt4 book ai didi

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

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

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

YangLeafRef.getCharPosition介绍

暂无

代码示例

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

/**
 * Returns leafref's error message.
 *
 * @param leafref leaf ref
 * @return error message
 */
static String getLeafRefErrorInfo(YangLeafRef leafref) {
  return getErrorMsg(
      LEAFREF_ERROR + leafref.getPath() + COMMA + IS_INVALID, EMPTY_STRING,
      leafref.getLineNumber(), leafref.getCharPosition(), leafref
          .getFileName());
}

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

} else {
  DataModelException ex = new DataModelException(getLeafRefErrorInfo(leafref));
  ex.setCharPosition(leafref.getCharPosition());
  ex.setLine(leafref.getLineNumber());
  ex.setFileName(leafref.getFileName());

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

/**
   * Returns data model error messages for leaf-ref with the path.
   *
   * @param msg     error message
   * @param leafRef YANG leaf-ref
   * @return data model exception
   */
  private static DataModelException getDataModelExc(String msg,
                           YangLeafRef leafRef) {
    DataModelException exc = new DataModelException(
        msg + leafRef.getPath());
    exc.setCharPosition(leafRef.getCharPosition());
    exc.setLine(leafRef.getLineNumber());
    return exc;
  }
}

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

@Override
public Object resolve()
    throws DataModelException {
  if (getReferredLeafOrLeafList() == null) {
    throw new DataModelException("Linker Error: The leafref does not refer to any leaf/leaf-list." +
        " in " +
        getLineNumber() + " at " +
        getCharPosition() +
        " in " + getFileName() + "\"");
  }
  // Initiate the resolution
  try {
    setResolvableStatus(getResolution());
  } catch (DataModelException e) {
    throw new DataModelException(e.getMessage());
  }
  return null;
}

代码示例来源: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-linker

/**
 * Validates the nodes in the path for any invalid node.
 *
 * @param leafref instance of YANG leafref
 */
private void validateInvalidNodesInThePath(YangLeafRef leafref) {
  for (YangAtomicPath absolutePath : (Iterable<YangAtomicPath>) leafref
      .getAtomicPath()) {
    YangNode nodeInPath = absolutePath.getResolvedNode();
    if (nodeInPath instanceof LeafRefInvalidHolder) {
      LinkerException ex = new LinkerException(
          LEAFREF_ERROR + leafref.getPath() + IS_INVALID);
      ex.setCharPosition(leafref.getCharPosition());
      ex.setLine(leafref.getLineNumber());
      ex.setFileName(leafref.getFileName());
      throw ex;
    }
  }
}

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

LinkerException ex = new LinkerException(
    FAILED_TO_FIND_LEAD_INFO_HOLDER + leafref.getPath());
ex.setCharPosition(leafref.getCharPosition());
ex.setLine(leafref.getLineNumber());
ex.setFileName(leafref.getFileName());

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

" in " +
    getLineNumber() + " at " +
    getCharPosition() +
    " in " + getFileName() + "\"");
    " in " +
    getLineNumber() + " at " +
    getCharPosition() +
    " in " + getFileName() + "\"");
    " in " +
    getLineNumber() + " at " +
    getCharPosition() +
    " in " + getFileName() + "\"");
    " in " +
    getLineNumber() + " at " +
    getCharPosition() +
    " in " + getFileName() + "\"");
" in " +
getLineNumber() + " at " +
getCharPosition() +
" in " + getFileName() + "\"");

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

LinkerException ex = new LinkerException(
    FAILED_TO_FIND_LEAD_INFO_HOLDER + leafRef.getPath());
ex.setCharPosition(leafRef.getCharPosition());
ex.setLine(leafRef.getLineNumber());
ex.setFileName(leafRef.getFileName());

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