gpt4 book ai didi

org.opendaylight.yangtools.yang.parser.impl.YangParserImpl类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 10:59:31 26 4
gpt4 key购买 nike

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

YangParserImpl介绍

暂无

代码示例

代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl

private synchronized Optional<SchemaContext> recreateSchemaContext() {
  try {
    ImmutableList<InputStream> streams = getAvailableStreams();
    YangParserImpl parser = new YangParserImpl();
    Set<Module> modules = parser.parseYangModelsFromStreams(streams);
    SchemaContext schemaContext = parser.resolveSchemaContext(modules);
    return Optional.of(schemaContext);
  } catch (IOException e) {
    LOG.error("Schema was not recreated.",e);
  }
  return Optional.absent();
}

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

@Override
public SchemaContext buildSchemaContext() throws YangParserException {
  try {
    return buildAction.buildEffective();
  } catch (ReactorException e) {
    throw decodeReactorException(e);
  }
}

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

@Override
public YangParser addSource(final SchemaSourceRepresentation source) throws IOException, YangSyntaxErrorException {
  buildAction.addSources(sourceToStatementStream(source));
  return null;
}

代码示例来源:origin: org.opendaylight.controller/yang-store-impl

static YangParserImpl getYangParserInstance() {
  return new YangParserImpl();
}

代码示例来源:origin: org.opendaylight.controller/sal-rest-connector

final YangParserImpl yangParser = new YangParserImpl();
final SchemaContext fakeSchemaCx = yangParser.resolveSchemaContext(fakeRpcModules);

代码示例来源:origin: org.opendaylight.controller/yang-store-impl

@Deprecated
public Map<Module, String> parseYangFilesToString(Collection<? extends InputStream> allYangs) {
  logger.error("Using deprecated method that will be removed soon", new UnsupportedOperationException("Deprecated"));
  YangParserImpl parser = YangParserWrapper.getYangParserInstance();
  Map<InputStream, Module> allYangModules = parser
      .parseYangModelsFromStreamsMapped(Lists.newArrayList(allYangs));
  Map<Module, String> retVal = new HashMap<>();
  for (Entry<InputStream, Module> entry : allYangModules.entrySet()) {
    try {
      retVal.put(entry.getValue(), IOUtils.toString(entry.getKey()));
    } catch (IOException e) {
      throw new IllegalStateException(
          "Can not create string from yang file.");
    }
  }
  return retVal;
}

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

@Override
  public YangParser createParser(final StatementParserMode parserMode) {
    return new YangParserImpl(reactor.newBuild(parserMode));
  }
}

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

@Override
  public YangParser createParser(final StatementParserMode parserMode) {
    return new YangParserImpl(reactor.newBuild(parserMode));
  }
}

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

@Override
public SchemaContext buildSchemaContext() throws YangParserException {
  try {
    return buildAction.buildEffective();
  } catch (ReactorException e) {
    throw decodeReactorException(e);
  }
}

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

@Override
public YangParser addSource(final SchemaSourceRepresentation source) throws IOException, YangSyntaxErrorException {
  buildAction.addSources(sourceToStatementStream(source));
  return null;
}

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

@Override
public Map<QNameModule, ModuleEffectiveStatement> buildEffectiveModel() throws YangParserException {
  final List<EffectiveStatement<?, ?>> effectiveStatements;
  try {
    effectiveStatements = buildAction.buildEffective().getRootEffectiveStatements();
  } catch (ReactorException e) {
    throw decodeReactorException(e);
  }
  return effectiveStatements.stream()
      .filter(ModuleEffectiveStatement.class::isInstance).map(ModuleEffectiveStatement.class::cast)
      .collect(toImmutableMap(ModuleEffectiveStatement::localQNameModule, identity()));
}

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

@Override
public YangParser addLibSource(final SchemaSourceRepresentation source) throws IOException,
    YangSyntaxErrorException {
  buildAction.addLibSources(sourceToStatementStream(source));
  return null;
}

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

@Override
public Map<QNameModule, ModuleEffectiveStatement> buildEffectiveModel() throws YangParserException {
  final List<EffectiveStatement<?, ?>> effectiveStatements;
  try {
    effectiveStatements = buildAction.buildEffective().getRootEffectiveStatements();
  } catch (ReactorException e) {
    throw decodeReactorException(e);
  }
  return effectiveStatements.stream()
      .filter(ModuleEffectiveStatement.class::isInstance).map(ModuleEffectiveStatement.class::cast)
      .collect(toImmutableMap(ModuleEffectiveStatement::localQNameModule, identity()));
}

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

@Override
public YangParser addLibSource(final SchemaSourceRepresentation source) throws IOException,
    YangSyntaxErrorException {
  buildAction.addLibSources(sourceToStatementStream(source));
  return null;
}

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

@Override
public List<DeclaredStatement<?>> buildDeclaredModel() throws YangParserException {
  try {
    return buildAction.build().getRootStatements();
  } catch (ReactorException e) {
    throw decodeReactorException(e);
  }
}

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

@Override
public List<DeclaredStatement<?>> buildDeclaredModel() throws YangParserException {
  try {
    return buildAction.build().getRootStatements();
  } catch (ReactorException e) {
    throw decodeReactorException(e);
  }
}

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