- final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild();
- final SchemaContext schemaContext;
- File file = null;
-
- try {
- file = new File("src/main/yang/entity-owners.yang");
- final List<ByteSource> sources = Arrays.asList(Resources.asByteSource(file.toURI().toURL()));
- try {
- schemaContext = reactor.buildEffective(sources);
- } catch (IOException e1) {
- throw new ExceptionInInitializerError(e1);
- } catch (ReactorException e2) {
- throw new RuntimeException("Unable to build schema context from " + sources, e2);
- }
- return schemaContext;
- } catch (MalformedURLException e3) {
- throw new RuntimeException("Malformed URL detected in " + file, e3);
- }