gpt4 book ai didi

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

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

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

YangCase介绍

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

代码示例

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

@Override
public void detectCollidingChild(String identifierName, YangConstructType dataType)
    throws DataModelException {
  if (!(getParent() instanceof YangChoice ||
      getParent() instanceof YangAugment)) {
    throw new DataModelException(getErrorMsg(
        INVALID_CASE_HOLDER, getName(), getLineNumber(),
        getCharPosition(), getFileName()));
  }
  // Traverse up in tree to ask parent choice start collision detection.
  ((CollisionDetector) getParent()).detectCollidingChild(identifierName, dataType);
}

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

@Override
public void setLeafParentContext() {
  // Add parent context for all leafs.
  for (YangLeaf yangLeaf : getListOfLeaf()) {
    yangLeaf.setParentContext(getParentSchemaContext(this));
  }
  // Add parent context for all leaf list.
  for (YangLeafList yangLeafList : getListOfLeafList()) {
    yangLeafList.setParentContext(getParentSchemaContext(this));
  }
}

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

caseNode.setLineNumber(ctx.getStart().getLine());
caseNode.setCharPosition(ctx.getStart().getCharPositionInLine());
caseNode.setFileName(listener.getFileName());
if (ctx.containerStatement() != null) {
  caseNode.setName(getValidIdentifier(ctx.containerStatement().identifier().getText(), CASE_DATA, ctx));
  errorConstructContext = ctx.containerStatement();
} else if (ctx.listStatement() != null) {
  caseNode.setName(getValidIdentifier(ctx.listStatement().identifier().getText(), CASE_DATA, ctx));
  errorConstructContext = ctx.listStatement();
} else if (ctx.leafListStatement() != null) {
  caseNode.setName(getValidIdentifier(ctx.leafListStatement().identifier().getText(), CASE_DATA, ctx));
  errorConstructContext = ctx.leafListStatement();
} else if (ctx.leafStatement() != null) {
  caseNode.setName(getValidIdentifier(ctx.leafStatement().identifier().getText(), CASE_DATA, ctx));
  errorConstructContext = ctx.leafStatement();
} else if (ctx.anyxmlStatement() != null) {
detectCollidingChildUtil(listener, line, charPositionInLine, caseNode.getName(), CASE_DATA);
  } catch (DataModelException e) {
    throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
        SHORT_CASE_DATA, caseNode.getName(), ENTRY, e.getMessage()));
      caseNode.getName(), ENTRY));

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

node.setParent(null);
YangCase javaCase = getYangCaseNode(JAVA_GENERATION);
javaCase.setName(node.getName());
javaCase.addChild(node);
for (YangLeaf leaf : augment.getListOfLeaf()) {
  YangCase javaCase = getYangCaseNode(JAVA_GENERATION);
  javaCase.setName(leaf.getName());
  javaCase.addLeaf(leaf);
  augment.addChild(javaCase);
for (YangLeafList leafList : augment.getListOfLeafList()) {
  YangCase javaCase = getYangCaseNode(JAVA_GENERATION);
  javaCase.setName(leafList.getName());
  javaCase.addLeafList(leafList);
  augment.addChild(javaCase);

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

caseNode.setName(identifier);
caseNode.setLineNumber(line);
caseNode.setCharPosition(charPositionInLine);
caseNode.setFileName(listener.getFileName());
YangNode curNode = (YangNode) curData;
try {

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

@Override
public void detectSelfCollision(String identifierName, YangConstructType dataType)
    throws DataModelException {
  if (dataType == CASE_DATA) {
    if (getName().equals(identifierName)) {
      throw new DataModelException(getErrorMsgCollision(
          COLLISION_DETECTION, getName(), getLineNumber(),
          getCharPosition(), CASE, getFileName()));
    }
    return;
  }
  // Asks helper to detect colliding child.
  detectCollidingChildUtil(identifierName, dataType, this);
}

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