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

x33g5p2x  于2022-02-05 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(63)

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

YangDeviateReplace介绍

[英]Represents deviate replace data represented in YANG.
[中]表示以YANG表示的偏离替换数据。

代码示例

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

/**
 * Performs validation and updates the data model tree. It is called when
 * parser receives an input matching the grammar rule(deviate replace).
 *
 * @param listener listener's object
 * @param ctx      context object of the grammar rule
 */
public static void processDeviateReplaceEntry(TreeWalkListener listener,
                       GeneratedYangParser
                           .DeviateReplaceStatementContext ctx) {
  // Check for stack to be non empty.
  checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_REPLACE,
             null, ENTRY);
  // TODO : Validate sub-statements cardinality
  Parsable curData = listener.getParsedDataStack().peek();
  if (curData instanceof YangDeviation) {
    YangDeviation curNode = (YangDeviation) curData;
    YangDeviateReplace deviationReplace = new YangDeviateReplace();
    curNode.addDeviateReplace(deviationReplace);
    listener.getParsedDataStack().push(deviationReplace);
  } else {
    throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, DEVIATE_REPLACE,
                                null, ENTRY));
  }
}

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

&& deviateReplace.getDataType() != null) {
((YangLeaf) targetNode).setDataType(deviateReplace.getDataType());
  && deviateReplace.getDataType() != null) {
((YangLeafList) targetNode).setDataType(deviateReplace
                        .getDataType());
((YangConfig) targetNode).setConfig(deviateReplace.isConfig());
((YangUnits) targetNode).setUnits(deviateReplace.getUnits());
    .setDefaultValueInString(deviateReplace.getDefaultValueInString());
((YangMandatory) targetNode).setMandatory(deviateReplace.isMandatory());
    .setMinElements(deviateReplace.getMinElements());
    .setMaxElements(deviateReplace.getMaxElements());

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

case DEVIATE_REPLACE:
  YangDeviateReplace replace = (YangDeviateReplace) tmpData;
  replace.setUnits(ctx.string().getText());
  break;
default:

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

case DEVIATE_REPLACE:
  YangDeviateReplace replace = (YangDeviateReplace) tmpData;
  replace.setDataType(type);
  break;
default:

相关文章