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.
|
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 . |
EffectiveModelContext |
trySchemaContext() |
EffectiveModelContext |
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 FluentFuture<YangTextSchemaSource> getSource(SourceIdentifier sourceIdentifier)
SchemaSourceProvider
MissingSchemaSourceException
.
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 EffectiveModelContext trySchemaContext() throws SchemaResolutionException
SchemaResolutionException
@Beta public EffectiveModelContext trySchemaContext(StatementParserMode statementParserMode) throws SchemaResolutionException
SchemaResolutionException
public void close()
close
in interface AutoCloseable
Copyright © 2020 OpenDaylight. All rights reserved.