Interface YangParser


  • @Beta
    @Deprecated(since="7.0.0",
                forRemoval=true)
    public interface YangParser
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use YangParser instead.
    Configurable single-use YANG parser. Each instance can be configured to use a different set of models after which it is built. Models once added cannot be removed. Implementations are expected to be NOT thread-safe.
    • Method Detail

      • supportedSourceRepresentations

        @NonNull Collection<Class<? extends SchemaSourceRepresentation>> supportedSourceRepresentations()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Return enumeration of concrete types of SchemaSourceRepresentation parsers created from this factory support. Users can use this information prepare the source they have to a representation which will be accepted by this parser.
        Returns:
        Enumeration of supported schema source representations.
      • supportedStatements

        @NonNull Set<QName> supportedStatements()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Return the set of all YANG statements semantically supported by this parser instance.
        Returns:
        Set of all YANG statements semantically supported by this parser instance.
      • addLibSources

        default @NonNull YangParser addLibSources​(SchemaSourceRepresentation... sources)
                                           throws IOException,
                                                  YangSyntaxErrorException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Add library sources. Only library sources required by main sources are present in resulting SchemaContext. Any other library sources are ignored and this also applies to error reporting.

        Note: Library sources are not supported in semantic version mode currently.

        Parameters:
        sources - YANG sources which should be added into library sources
        Throws:
        YangSyntaxErrorException - when one of the sources fails syntactic analysis
        IOException - when an IO error occurs
        IllegalArgumentException - if the representation is not supported
      • setSupportedFeatures

        @NonNull YangParser setSupportedFeatures​(@NonNull Set<QName> supportedFeatures)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Set supported features based on which all if-feature statements in the parsed YANG modules will be resolved. If this method is not invoked, all features will be supported.
        Parameters:
        supportedFeatures - Set of supported features in the final SchemaContext. If the set is empty, no features encountered will be supported.
      • setModulesWithSupportedDeviations

        @NonNull YangParser setModulesWithSupportedDeviations​(@NonNull SetMultimap<QNameModule,​QNameModule> modulesDeviatedByModules)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Set YANG modules which can be deviated by specified modules during the parsing process. Map key (QNameModule) denotes a module which can be deviated by the modules in the Map value.
        Parameters:
        modulesDeviatedByModules - Map of YANG modules (Map key) which can be deviated by specified modules (Map value) in the final SchemaContext. If the map is empty, no deviations encountered will be supported.
      • buildDeclaredModel

        @NonNull List<DeclaredStatement<?>> buildDeclaredModel()
                                                        throws YangParserException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Build the declared view of a combined view of declared statements.
        Returns:
        Ordered collection of declared statements from requested sources.
        Throws:
        YangSyntaxErrorException - When a syntactic error is encountered.
        YangParserException
      • buildEffectiveModel

        @NonNull EffectiveModelContext buildEffectiveModel()
                                                    throws YangParserException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Build the effective view of a combined view of effective statements. Note that this representation, unlike buildDeclaredModel() does not expose submodules as top-level contracts. These are available from their respective parent modules.
        Returns:
        Effective module statements indexed by their QNameModule.
        Throws:
        YangSyntaxErrorException - When a syntactic error is encountered.
        YangParserException