gpt4 book ai didi

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

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

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

YangLeafRef.getPath介绍

[英]Returns the path of the leafref.
[中]返回leafref的路径。

代码示例

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

/**
   * 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-parser

/**
 * Returns the path syntax parser exception.
 *
 * @param pathCtx     yang construct's context to get the line number
 *                    and character position
 * @param yangLeafRef YANG leaf-ref data model information
 * @return parser exception
 */
private static ParserException getPathException(PathStatementContext pathCtx,
                        YangLeafRef yangLeafRef) {
  ParserException exception = new ParserException(
      "YANG file error : Path " + yangLeafRef.getPath() +
          " does not follow valid path syntax");
  exception.setLine(pathCtx.getStart().getLine());
  exception.setCharPosition(pathCtx.getStart().getCharPositionInLine());
  return exception;
}

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

} else {
  LinkerException ex = new LinkerException(
      FAILED_TO_FIND_LEAD_INFO_HOLDER + leafref.getPath());
  ex.setCharPosition(leafref.getCharPosition());
  ex.setLine(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

} else {
  LinkerException ex = new LinkerException(
      FAILED_TO_FIND_LEAD_INFO_HOLDER + leafRef.getPath());
  ex.setCharPosition(leafRef.getCharPosition());
  ex.setLine(leafRef.getLineNumber());

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