Class YangTextSchemaContextResolver

  • All Implemented Interfaces:
    AutoCloseable, org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider<org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource>

    public final class YangTextSchemaContextResolver
    extends Object
    implements AutoCloseable, org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider<org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource>
    • Method Detail

      • registerSource

        public @NonNull YangTextSchemaSourceRegistration registerSource​(@NonNull org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource source)
                                                                 throws org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException,
                                                                        IOException,
                                                                        org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException
        Register a YangTextSchemaSource.
        Parameters:
        source - YANG text source
        Returns:
        a YangTextSchemaSourceRegistration
        Throws:
        org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException - When the YANG file is syntactically invalid
        IOException - when the URL is not readable
        org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException - When parsing encounters general error
      • registerSource

        public @NonNull YangTextSchemaSourceRegistration registerSource​(@NonNull URL url)
                                                                 throws org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException,
                                                                        IOException,
                                                                        org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException
        Register a URL containing a YANG text.
        Parameters:
        url - YANG text source URL
        Returns:
        a YangTextSchemaSourceRegistration for this URL
        Throws:
        org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException - When the YANG file is syntactically invalid
        IOException - when the URL is not readable
        org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException - When parsing encounters general error
      • getEffectiveModelContext

        public Optional<? extends org.opendaylight.yangtools.yang.model.api.EffectiveModelContext> getEffectiveModelContext()
        Try to parse all currently available yang files and build new schema context.
        Returns:
        new schema context iif there is at least 1 yang file registered and new schema context was successfully built.
      • getEffectiveModelContext

        public Optional<? extends org.opendaylight.yangtools.yang.model.api.EffectiveModelContext> getEffectiveModelContext​(org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode statementParserMode)
        Try to parse all currently available yang files and build new schema context depending on specified parsing mode.
        Parameters:
        statementParserMode - mode of statement parser
        Returns:
        new schema context iif there is at least 1 yang file registered and new schema context was successfully built.
      • getSource

        public @NonNull com.google.common.util.concurrent.FluentFuture<org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource> getSource​(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier)
        Specified by:
        getSource in interface org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider<org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource>
      • getAvailableSources

        public Set<org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier> getAvailableSources()
        Return the set of sources currently available in this resolved.
        Returns:
        An immutable point-in-time view of available sources.
      • getSourceTexts

        @Beta
        public Collection<org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource> getSourceTexts​(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier sourceIdentifier)
      • trySchemaContext

        @Beta
        public org.opendaylight.yangtools.yang.model.api.EffectiveModelContext trySchemaContext()
                                                                                         throws org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException
        Throws:
        org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException
      • trySchemaContext

        @Beta
        public org.opendaylight.yangtools.yang.model.api.EffectiveModelContext trySchemaContext​(org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode statementParserMode)
                                                                                         throws org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException
        Throws:
        org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException