gpt4 book ai didi

org.opendaylight.yangtools.yang.model.parser.api.YangParser.addSource()方法的使用及代码示例

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

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

YangParser.addSource介绍

[英]Add main source. All main sources are present in resulting SchemaContext.
[中]添加主要来源。所有主要来源都出现在文本中。

代码示例

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

default YangParser addSources(final Collection<? extends SchemaSourceRepresentation> sources) throws IOException,
  YangSyntaxErrorException {
  for (SchemaSourceRepresentation source : sources) {
    addSource(source);
  }
  return this;
}

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

/**
 * Add main sources. All main sources are present in resulting SchemaContext.
 *
 * @param sources which should be added into main sources
 * @throws YangSyntaxErrorException when one of the sources fails syntactic analysis
 * @throws IOException when an IO error occurs
 * @throws IllegalArgumentException if the representation is not supported
 */
default YangParser addSources(final SchemaSourceRepresentation... sources) throws IOException,
  YangSyntaxErrorException {
  for (SchemaSourceRepresentation source : sources) {
    addSource(source);
  }
  return this;
}

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

final ASTSchemaSource astSource = TextToASTTransformer.transformText(textSource);
parser.addSource(astSource);

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

static SchemaContext parseYangSources(final Set<QName> supportedFeatures, final List<File> testFiles,
    final List<File> libFiles) throws IOException, YangParserException {
  checkArgument(!testFiles.isEmpty(), "No yang sources");
  final YangParser parser = PARSER_FACTORY.createParser();
  if (supportedFeatures != null) {
    parser.setSupportedFeatures(supportedFeatures);
  }
  for (File file : testFiles) {
    parser.addSource(YangTextSchemaSource.forFile(file));
  }
  for (File file : libFiles) {
    parser.addLibSource(YangTextSchemaSource.forFile(file));
  }
  return parser.buildSchemaContext();
}

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