@Beta public interface YangNamespaceContext extends Immutable, Serializable
String
prefixes and QNameModule
namespaces. The conceptual model
matches prefix mapping inside a YANG module
as defined through the use of prefix
and import
statements and detailed in RFC7950 Section 7.1.4.
Each namespace context has a set of prefix/namespace mappings. A namespace can be bound to multiple prefixes at the same time.
Modifier and Type | Method and Description |
---|---|
default @NonNull QName |
createQName(String prefix,
String localName)
Create a
QName by resolving a prefix against currently-bound prefixes and combining it with specified
local name. |
@NonNull Optional<QNameModule> |
findNamespaceForPrefix(String prefix)
Return QNameModule to which a particular prefix is bound.
|
@NonNull Optional<String> |
findPrefixForNamespace(QNameModule namespace)
Return a prefix to which a particular QNameModule is bound.
|
@NonNull Optional<QNameModule> findNamespaceForPrefix(String prefix)
prefix
- Prefix to look upNullPointerException
- if prefix
is null@NonNull Optional<String> findPrefixForNamespace(QNameModule namespace)
namespace
- QNameModule to look upNullPointerException
- if module
is nulldefault @NonNull QName createQName(String prefix, String localName)
QName
by resolving a prefix against currently-bound prefixes and combining it with specified
local name.prefix
- Namespace prefixlocalName
- QName local nameNullPointerException
- if any argument is nullIllegalArgumentException
- if localName
does not conform to local name requirements or if the
prefix is not bound in this context.Copyright © 2020 OpenDaylight. All rights reserved.