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.UseYangParser
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 Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description YangParser
addLibSource(SchemaSourceRepresentation source)
Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull YangParser
addLibSources(Collection<SchemaSourceRepresentation> sources)
Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull YangParser
addLibSources(SchemaSourceRepresentation... sources)
Deprecated, for removal: This API element is subject to removal in a future version.Add library sources.@NonNull YangParser
addSource(SchemaSourceRepresentation source)
Deprecated, for removal: This API element is subject to removal in a future version.Add main source.default @NonNull YangParser
addSources(Collection<? extends SchemaSourceRepresentation> sources)
Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull YangParser
addSources(SchemaSourceRepresentation... sources)
Deprecated, for removal: This API element is subject to removal in a future version.Add main sources.@NonNull List<DeclaredStatement<?>>
buildDeclaredModel()
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.@NonNull EffectiveModelContext
buildEffectiveModel()
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.default @NonNull SchemaContext
buildSchemaContext()
Deprecated, for removal: This API element is subject to removal in a future version.UsebuildEffectiveModel()
instead.@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.@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.@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 ofSchemaSourceRepresentation
parsers created from this factory support.@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.
-
-
-
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 ofSchemaSourceRepresentation
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.
-
addSource
@NonNull YangParser addSource(SchemaSourceRepresentation source) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.Add main source. All main sources are present in resulting SchemaContext.- Parameters:
source
- which should be added into main sources- Throws:
YangSyntaxErrorException
- when one of the sources fails syntactic analysisIOException
- when an IO error occursIllegalArgumentException
- if the representation is not supported
-
addSources
default @NonNull YangParser addSources(SchemaSourceRepresentation... sources) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.Add main sources. All main sources are present in resulting SchemaContext.- Parameters:
sources
- which should be added into main sources- Throws:
YangSyntaxErrorException
- when one of the sources fails syntactic analysisIOException
- when an IO error occursIllegalArgumentException
- if the representation is not supported
-
addSources
default @NonNull YangParser addSources(Collection<? extends SchemaSourceRepresentation> sources) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
YangSyntaxErrorException
-
addLibSource
YangParser addLibSource(SchemaSourceRepresentation source) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
YangSyntaxErrorException
-
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 analysisIOException
- when an IO error occursIllegalArgumentException
- if the representation is not supported
-
addLibSources
default @NonNull YangParser addLibSources(Collection<SchemaSourceRepresentation> sources) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
YangSyntaxErrorException
-
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, unlikebuildDeclaredModel()
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
-
buildSchemaContext
@Deprecated(forRemoval=true) default @NonNull SchemaContext buildSchemaContext() throws YangParserException
Deprecated, for removal: This API element is subject to removal in a future version.UsebuildEffectiveModel()
instead.Build effectiveSchemaContext
.- Returns:
- An effective schema context comprised of configured models.
- Throws:
YangSyntaxErrorException
- When a syntactic error is encountered.YangParserException
-
-