@Beta public final class ModuleNameNamespaceContext extends Object implements YangNamespaceContext, SchemaContextProvider
YangNamespaceContext
backed by a SchemaContext, resolving namespaces to their module names. This
is useful for implementing namespace resolution according to
RFC7951 Section 4.
When multiple revisions of a particular namespace are present in the backing SchemaContext, this ambiguity is resolved by using the latest revision available.
Constructor and Description |
---|
ModuleNameNamespaceContext(SchemaContext schemaContext) |
Modifier and Type | Method and Description |
---|---|
Optional<QNameModule> |
findNamespaceForPrefix(String prefix)
Return QNameModule to which a particular prefix is bound.
|
Optional<String> |
findPrefixForNamespace(QNameModule namespace)
Return a prefix to which a particular QNameModule is bound.
|
SchemaContext |
getSchemaContext() |
BiMapYangNamespaceContext |
toBiMap()
Convert this object to an equivalent
BiMapYangNamespaceContext . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createQName
public ModuleNameNamespaceContext(SchemaContext schemaContext)
public BiMapYangNamespaceContext toBiMap()
BiMapYangNamespaceContext
.public SchemaContext getSchemaContext()
getSchemaContext
in interface SchemaContextProvider
public Optional<QNameModule> findNamespaceForPrefix(String prefix)
YangNamespaceContext
findNamespaceForPrefix
in interface YangNamespaceContext
prefix
- Prefix to look uppublic Optional<String> findPrefixForNamespace(QNameModule namespace)
YangNamespaceContext
findPrefixForNamespace
in interface YangNamespaceContext
namespace
- QNameModule to look upCopyright © 2020 OpenDaylight. All rights reserved.