Class ModuleNameNamespaceContext
java.lang.Object
org.opendaylight.yangtools.yang.model.util.ModuleNameNamespaceContext
- All Implemented Interfaces:
Serializable,Immutable,YangNamespaceContext
Utility
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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnamespaceForPrefix(String prefix) Return QNameModule to which a particular prefix is bound.prefixForNamespace(QNameModule namespace) Return a prefix to which a particular QNameModule is bound.toBiMap()Convert this object to an equivalentBiMapYangNamespaceContext.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opendaylight.yangtools.yang.common.YangNamespaceContext
createQName, findNamespaceForPrefix, findPrefixForNamespace
-
Constructor Details
-
ModuleNameNamespaceContext
-
-
Method Details
-
toBiMap
Convert this object to an equivalentBiMapYangNamespaceContext.- Returns:
- A BiMapYangNamespaceContext.
-
namespaceForPrefix
Description copied from interface:YangNamespaceContextReturn QNameModule to which a particular prefix is bound.- Specified by:
namespaceForPrefixin interfaceYangNamespaceContext- Parameters:
prefix- Prefix to look up- Returns:
- QNameModule bound to specified prefix, or
null
-
prefixForNamespace
Description copied from interface:YangNamespaceContextReturn a prefix to which a particular QNameModule is bound. If a namespace is bound to multiple prefixes, it is left unspecified which of those prefixes is returned.- Specified by:
prefixForNamespacein interfaceYangNamespaceContext- Parameters:
namespace- QNameModule to look up- Returns:
- Prefix to which the QNameModule is bound, or
null
-