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.UseYangParserinstead.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 YangParseraddLibSource(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation source)Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull YangParseraddLibSources(Collection<org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> sources)Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull YangParseraddLibSources(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation... sources)Deprecated, for removal: This API element is subject to removal in a future version.Add library sources.@NonNull YangParseraddSource(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation source)Deprecated, for removal: This API element is subject to removal in a future version.Add main source.default @NonNull YangParseraddSources(Collection<? extends org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> sources)Deprecated, for removal: This API element is subject to removal in a future version.default @NonNull YangParseraddSources(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation... sources)Deprecated, for removal: This API element is subject to removal in a future version.Add main sources.@NonNull List<org.opendaylight.yangtools.yang.model.api.meta.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 org.opendaylight.yangtools.yang.model.api.EffectiveModelContextbuildEffectiveModel()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 org.opendaylight.yangtools.yang.model.api.SchemaContextbuildSchemaContext()Deprecated, for removal: This API element is subject to removal in a future version.UsebuildEffectiveModel()instead.@NonNull YangParsersetModulesWithSupportedDeviations(@NonNull com.google.common.collect.SetMultimap<org.opendaylight.yangtools.yang.common.QNameModule,org.opendaylight.yangtools.yang.common.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 YangParsersetSupportedFeatures(@NonNull Set<org.opendaylight.yangtools.yang.common.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 org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>>supportedSourceRepresentations()Deprecated, for removal: This API element is subject to removal in a future version.Return enumeration of concrete types ofSchemaSourceRepresentationparsers created from this factory support.@NonNull Set<org.opendaylight.yangtools.yang.common.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 org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation>> supportedSourceRepresentations()
Deprecated, for removal: This API element is subject to removal in a future version.Return enumeration of concrete types ofSchemaSourceRepresentationparsers 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<org.opendaylight.yangtools.yang.common.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(org.opendaylight.yangtools.yang.model.repo.api.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(org.opendaylight.yangtools.yang.model.repo.api.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 org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> sources) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOExceptionYangSyntaxErrorException
-
addLibSource
YangParser addLibSource(org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation source) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOExceptionYangSyntaxErrorException
-
addLibSources
default @NonNull YangParser addLibSources(org.opendaylight.yangtools.yang.model.repo.api.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<org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation> sources) throws IOException, YangSyntaxErrorException
Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOExceptionYangSyntaxErrorException
-
setSupportedFeatures
@NonNull YangParser setSupportedFeatures(@NonNull Set<org.opendaylight.yangtools.yang.common.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 com.google.common.collect.SetMultimap<org.opendaylight.yangtools.yang.common.QNameModule,org.opendaylight.yangtools.yang.common.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<org.opendaylight.yangtools.yang.model.api.meta.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 org.opendaylight.yangtools.yang.model.api.EffectiveModelContext buildEffectiveModel() throws YangParserExceptionDeprecated, 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 org.opendaylight.yangtools.yang.model.api.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
-
-