@ThreadSafe public class YangSourceContext extends Object implements org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream>, Closeable, org.opendaylight.yangtools.concepts.Delegator<org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream>>
getValidSources() - set of SourceIdentifier which have
their dependencies present and are safe to be used by full blown parser.
getMissingSources() - set of SourceIdentifier which have
been referenced by other YANG sources, but source code for them is missing.
getMissingDependencies() - map of SourceIdentifier and
their imports for which source codes was not available.
YangSourceContext may be associated with SchemaSourceProvider
(see getDelegate(), which was used for retrieval of sources during
context computation.
YangSourceContext may be used as schema source provider to retrieve
this sources.| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static YangSourceContext |
createFrom(Iterable<org.opendaylight.yangtools.yang.common.QName> capabilities,
org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider<InputStream> schemaSourceProvider)
Creates YANG Source context from supplied capabilities and schema source
provider.
|
static YangSourceContext |
createFrom(Map<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier,YangModelDependencyInfo> moduleDependencies,
org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream> sourceProvider) |
org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream> |
getDelegate() |
com.google.common.collect.ImmutableMultimap<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier,org.opendaylight.yangtools.yang.model.api.ModuleImport> |
getMissingDependencies()
Returns a multimap of Source Identifier and imports which had missing
sources.
|
com.google.common.collect.ImmutableSet<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier> |
getMissingSources()
Returns set of source identifiers, whom sources was not resolved.
|
com.google.common.base.Optional<InputStream> |
getSchemaSource(org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier sourceIdentifier) |
com.google.common.base.Optional<InputStream> |
getSchemaSource(String moduleName,
com.google.common.base.Optional<String> revision) |
Collection<com.google.common.io.ByteSource> |
getValidByteSources() |
List<InputStream> |
getValidInputStreams()
Deprecated.
|
static List<InputStream> |
getValidInputStreams(YangSourceContext context)
Deprecated.
|
com.google.common.collect.ImmutableSet<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier> |
getValidSources()
Returns set of valid source identifiers.
|
public com.google.common.collect.ImmutableSet<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier> getValidSources()
YangSourceContext.public com.google.common.collect.ImmutableSet<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier> getMissingSources()
YangSourceContext.public com.google.common.collect.ImmutableMultimap<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier,org.opendaylight.yangtools.yang.model.api.ModuleImport> getMissingDependencies()
public com.google.common.base.Optional<InputStream> getSchemaSource(String moduleName, com.google.common.base.Optional<String> revision)
getSchemaSource in interface org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider<InputStream>public com.google.common.base.Optional<InputStream> getSchemaSource(org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier sourceIdentifier)
getSchemaSource in interface org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream>public org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream> getDelegate()
getDelegate in interface org.opendaylight.yangtools.concepts.Delegator<org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream>>public void close()
close in interface Closeableclose in interface AutoCloseablepublic static YangSourceContext createFrom(Iterable<org.opendaylight.yangtools.yang.common.QName> capabilities, org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider<InputStream> schemaSourceProvider)
capabilities - Set of QName representing module capabilities,
QName.getLocalName() represents
source name and QName.getRevision() represents
revision of source.schemaSourceProvider - - SchemaSourceProvider which should be used to resolve
sources.public static YangSourceContext createFrom(Map<org.opendaylight.yangtools.yang.model.util.repo.SourceIdentifier,YangModelDependencyInfo> moduleDependencies, org.opendaylight.yangtools.yang.model.util.repo.AdvancedSchemaSourceProvider<InputStream> sourceProvider)
@Deprecated public List<InputStream> getValidInputStreams()
getValidByteSources()public Collection<com.google.common.io.ByteSource> getValidByteSources() throws IOException
IOException@Deprecated public static List<InputStream> getValidInputStreams(YangSourceContext context)
Copyright © 2014. All rights reserved.