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.
|
com.google.common.base.Optional<SchemaContext> |
getSchemaContext()
Try to parse all currently available yang files and build new schema context.
|
com.google.common.base.Optional<SchemaContext> |
getSchemaContext(StatementParserMode statementParserMode)
Try to parse all currently available yang files and build new schema context
in dependence on specified parsing mode.
|
com.google.common.util.concurrent.CheckedFuture<YangTextSchemaSource,SchemaSourceException> |
getSource(SourceIdentifier sourceIdentifier)
Returns a representation a for supplied YANG source identifier.
|
YangTextSchemaSourceRegistration |
registerSource(URL url)
Register a URL containing a YANG text.
|
YangTextSchemaSourceRegistration |
registerSource(YangTextSchemaSource source)
Register a
YangTextSchemaSource. |
public static YangTextSchemaContextResolver create(String name)
public 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 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 com.google.common.base.Optional<SchemaContext> getSchemaContext()
public com.google.common.base.Optional<SchemaContext> getSchemaContext(StatementParserMode statementParserMode)
statementParserMode - mode of statement parserpublic com.google.common.util.concurrent.CheckedFuture<YangTextSchemaSource,SchemaSourceException> getSource(SourceIdentifier sourceIdentifier)
SchemaSourceProviderMissingSchemaSourceException.
MissingSchemaSourceException.
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()
public void close()
close in interface AutoCloseableCopyright © 2018 OpenDaylight. All rights reserved.