gpt4 book ai didi

org.opendaylight.yangtools.yang.common.YangVersion类的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 05:33:31 32 4
gpt4 key购买 nike

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

YangVersion介绍

[英]Enumeration of supported YANG versions.
[中]支持的版本的枚举。

代码示例

代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950

private static boolean areFeaturesSupported(final StmtContext<?, ?, ?> subStmtCtx) {
  /*
   * In case of Yang 1.1, checks whether features are supported.
   */
  return !YangVersion.VERSION_1_1.equals(subStmtCtx.getRootVersion()) || subStmtCtx.isSupportedByFeatures();
}

代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950

@Override
public YangVersion parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
  return SourceException.unwrap(YangVersion.parse(value), ctx.getStatementSourceReference(),
    "Unsupported YANG version %s", value);
}

代码示例来源:origin: org.opendaylight.yangtools/yang-model-export

private void emitYangVersionNode(final YangVersion input) {
  super.writer.startYangVersionNode(input.toString());
  super.writer.endNode();
}

代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950

@Override
public Predicate<Set<QName>> parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
  if (YangVersion.VERSION_1_1.equals(ctx.getRootVersion())) {
    return IfFeaturePredicateVisitor.parseIfFeatureExpression(ctx, value);
  }
  final QName qname = StmtContextUtils.parseNodeIdentifier(ctx, value);
  return setQNames -> setQNames.contains(qname);
}

代码示例来源:origin: opendaylight/yangtools

private static boolean isRelevantForIfFeatureAndWhenOnListKeysCheck(final StmtContext<?, ?, ?> ctx) {
  return YangVersion.VERSION_1_1.equals(ctx.getRootVersion())
      && StmtContextUtils.hasParentOfType(ctx, YangStmtMapping.LIST)
      && StmtContextUtils.findFirstDeclaredSubstatement(ctx.coerceParentContext(),
        KeyStatement.class) != null;
}

代码示例来源:origin: org.opendaylight.yangtools/yang-parser-rfc7950

static void copyFromSourceToTarget(final StatementContextBase<?, ?, ?> sourceCtx,
    final StatementContextBase<?, ?, ?> targetCtx) {
  final CopyType typeOfCopy = UsesStatement.class.equals(sourceCtx.coerceParentContext().getPublicDefinition()
      .getDeclaredRepresentationClass()) ? CopyType.ADDED_BY_USES_AUGMENTATION
      : CopyType.ADDED_BY_AUGMENTATION;
  /*
   * Since Yang 1.1, if an augmentation is made conditional with a
   * "when" statement, it is allowed to add mandatory nodes.
   */
  final boolean skipCheckOfMandatoryNodes = YangVersion.VERSION_1_1.equals(sourceCtx.getRootVersion())
      && isConditionalAugmentStmt(sourceCtx);
  final Collection<? extends Mutable<?, ?, ?>> declared = sourceCtx.mutableDeclaredSubstatements();
  final Collection<? extends Mutable<?, ?, ?>> effective = sourceCtx.mutableEffectiveSubstatements();
  final Collection<Mutable<?, ?, ?>> buffer = new ArrayList<>(declared.size() + effective.size());
  for (final Mutable<?, ?, ?> originalStmtCtx : declared) {
    if (originalStmtCtx.isSupportedByFeatures()) {
      copyStatement(originalStmtCtx, targetCtx, typeOfCopy, buffer, skipCheckOfMandatoryNodes);
    }
  }
  for (final Mutable<?, ?, ?> originalStmtCtx : effective) {
    copyStatement(originalStmtCtx, targetCtx, typeOfCopy, buffer, skipCheckOfMandatoryNodes);
  }
  targetCtx.addEffectiveSubstatements(buffer);
}

代码示例来源:origin: opendaylight/yangtools

} else if (!RootStatementContext.DEFAULT_VERSION.equals(root.getRootVersion())
    && inProgressPhase == ModelProcessingPhase.SOURCE_LINKAGE) {
  root = new RootStatementContext<>(this, def, ref, argument, root.getRootVersion(),

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