本文整理了Java中org.opendaylight.yangtools.yang.parser.impl.YangParserImpl
类的一些代码示例,展示了YangParserImpl
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangParserImpl
类的具体详情如下:
包路径:org.opendaylight.yangtools.yang.parser.impl.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);
}
}
内容来源于网络,如有侵权,请联系作者删除!