Interface NamespaceStmtCtx
-
- All Superinterfaces:
CommonStmtCtx
- All Known Subinterfaces:
EffectiveStmtCtx.Current<A,D>
,EffectiveStmtCtx.UndeclaredCurrent<A,D>
,RootStmtContext<A,D,E>
,RootStmtContext.Mutable<A,D,E>
,StmtContext<A,D,E>
,StmtContext.Mutable<A,D,E>
- All Known Implementing Classes:
RootStatementContext
@Beta public interface NamespaceStmtCtx extends CommonStmtCtx
Support work with namespace content.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <K,V,N extends ParserNamespace<K,V>>
Map<K,V>getAllFromNamespace(Class<N> nsType)
Return the selected namespace.default <K,V,T extends K,N extends ParserNamespace<K,V>>
@Nullable VgetFromNamespace(Class<@NonNull N> type, T key)
Return a value associated with specified key within a namespace.<K,V,N extends ParserNamespace<K,V>>
@Nullable Map<K,V>localNamespacePortion(Class<@NonNull N> nsType)
Return the portion of specified namespace stored in this node.<K,V,N extends ParserNamespace<K,V>>
@Nullable Map<K,V>namespace(Class<@NonNull N> nsType)
Return the selected namespace.<K,V,T extends K,N extends ParserNamespace<K,V>>
@Nullable VnamespaceItem(Class<@NonNull N> nsType, T key)
Return a value associated with specified key within a namespace.-
Methods inherited from interface org.opendaylight.yangtools.yang.parser.spi.meta.CommonStmtCtx
getRawArgument, producesDeclared, producesEffective, publicDefinition, rawArgument, sourceReference
-
-
-
-
Method Detail
-
namespace
<K,V,N extends ParserNamespace<K,V>> @Nullable Map<K,V> namespace(Class<@NonNull N> nsType)
Return the selected namespace.- Type Parameters:
K
- namespace key typeV
- namespace value typeN
- namespace type- Parameters:
nsType
- namespace type class- Returns:
- Namespace contents, if available
-
namespaceItem
<K,V,T extends K,N extends ParserNamespace<K,V>> @Nullable V namespaceItem(Class<@NonNull N> nsType, T key)
Return a value associated with specified key within a namespace.- Type Parameters:
K
- namespace key typeV
- namespace value typeN
- namespace typeT
- key type- Parameters:
nsType
- Namespace typekey
- Key- Returns:
- Value, or null if there is no element
- Throws:
NamespaceNotAvailableException
- when the namespace is not available.
-
localNamespacePortion
<K,V,N extends ParserNamespace<K,V>> @Nullable Map<K,V> localNamespacePortion(Class<@NonNull N> nsType)
Return the portion of specified namespace stored in this node. Depending on namespace behaviour this may or may not represent the complete contents of the namespace as available vianamespace(Class)
.This partial view is useful when the need is not to perform a proper namespace lookup, but rather act on current statement's contribution to the namespace.
- Type Parameters:
K
- namespace key typeV
- namespace value typeN
- namespace type- Parameters:
nsType
- namespace type class- Returns:
- Namespace portion stored in this node, if available
-
getAllFromNamespace
default <K,V,N extends ParserNamespace<K,V>> Map<K,V> getAllFromNamespace(Class<N> nsType)
Return the selected namespace.- Type Parameters:
K
- namespace key typeV
- namespace value typeN
- namespace type- Parameters:
nsType
- namespace type class- Returns:
- Namespace contents, if available
-
getFromNamespace
default <K,V,T extends K,N extends ParserNamespace<K,V>> @Nullable V getFromNamespace(Class<@NonNull N> type, T key)
Return a value associated with specified key within a namespace.- Type Parameters:
K
- namespace key typeV
- namespace value typeN
- namespace typeT
- key type- Parameters:
type
- Namespace typekey
- Key- Returns:
- Value, or null if there is no element
- Throws:
NamespaceNotAvailableException
- when the namespace is not available.
-
-