public final class YangTextSchemaContextResolver extends Object implements AutoCloseable, SchemaSourceProvider<YangTextSchemaSource>
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static YangTextSchemaContextResolver |
create(String name) |
Set<SourceIdentifier> |
getAvailableSources()
Return the set of sources currently available in this resolved.
|
Optional<SchemaContext> |
getSchemaContext()
Try to parse all currently available yang files and build new schema context.
|
Optional<SchemaContext> |
getSchemaContext(StatementParserMode statementParserMode)
Try to parse all currently available yang files and build new schema context depending on specified parsing mode.
|
com.google.common.util.concurrent.FluentFuture<YangTextSchemaSource> |
getSource(SourceIdentifier sourceIdentifier)
Returns a representation a for supplied YANG source identifier.
|
Collection<YangTextSchemaSource> |
getSourceTexts(SourceIdentifier sourceIdentifier) |
@NonNull YangTextSchemaSourceRegistration |
registerSource(@NonNull URL url)
Register a URL containing a YANG text.
|
@NonNull YangTextSchemaSourceRegistration |
registerSource(@NonNull YangTextSchemaSource source)
Register a
YangTextSchemaSource. |
SchemaContext |
trySchemaContext() |
SchemaContext |
trySchemaContext(StatementParserMode statementParserMode) |
public static YangTextSchemaContextResolver create(String name)
public @NonNull YangTextSchemaSourceRegistration registerSource(@NonNull YangTextSchemaSource source) throws SchemaSourceException, IOException, YangSyntaxErrorException
YangTextSchemaSource.source - YANG text sourceYangSyntaxErrorException - When the YANG file is syntactically invalidIOException - when the URL is not readableSchemaSourceException - When parsing encounters general errorpublic @NonNull YangTextSchemaSourceRegistration registerSource(@NonNull URL url) throws SchemaSourceException, IOException, YangSyntaxErrorException
url - YANG text source URLYangSyntaxErrorException - When the YANG file is syntactically invalidIOException - when the URL is not readableSchemaSourceException - When parsing encounters general errorpublic Optional<SchemaContext> getSchemaContext()
public Optional<SchemaContext> getSchemaContext(StatementParserMode statementParserMode)
statementParserMode - mode of statement parserpublic com.google.common.util.concurrent.FluentFuture<YangTextSchemaSource> getSource(SourceIdentifier sourceIdentifier)
SchemaSourceProviderMissingSchemaSourceException.
MissingSchemaSourceException.
In either case the returned representation is required to report a non-null
revision in the SourceIdentifier returned from
SchemaSourceRepresentation.getIdentifier().
Implementations are not required to provide constant behavior in time, notably this different invocation of this method may produce different results.
getSource in interface SchemaSourceProvider<YangTextSchemaSource>sourceIdentifier - source identifierpublic Set<SourceIdentifier> getAvailableSources()
@Beta public Collection<YangTextSchemaSource> getSourceTexts(SourceIdentifier sourceIdentifier)
@Beta public SchemaContext trySchemaContext() throws SchemaResolutionException
SchemaResolutionException@Beta public SchemaContext trySchemaContext(StatementParserMode statementParserMode) throws SchemaResolutionException
SchemaResolutionExceptionpublic void close()
close in interface AutoCloseableCopyright © 2019 OpenDaylight. All rights reserved.