Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
themeMidnight
titleCorrected Code
linenumberstrue
collapsetrue
        YangTextSchemaSource source = YangTextSchemaSource.forFile(new File("/example.yang"));
        StatementStreamSource yangModuleSource = YangStatementStreamSource.create(source);

        CrossSourceStatementReactor.BuildAction reactor = defaultReactor().newBuild();
        reactor.addSource(yangModuleSource);

        SchemaContext schemaContext = reactor.buildEffective();

        Set<Module> modules = schemaContext.getModules();
        Set<DataSchemaNode> dataSchemaNodes = schemaContext.getDataDefinitions();

This is the kind of object (module) that gets created:

Image Added