private void updateAugmentOrder(final StatementContextBase<?, ?, ?> augmentSourceCtx) { Integer currentOrder = augmentSourceCtx.getFromNamespace(StmtOrderingNamespace.class, YangStmtMapping.AUGMENT); if (currentOrder == null) { currentOrder = 1; } else { currentOrder++; } augmentSourceCtx.addToNs(StmtOrderingNamespace.class, YangStmtMapping.AUGMENT, currentOrder); }
final <K, V, N extends IdentifierNamespace<K, V>> void selectMatch(final Class<N> type, final NamespaceKeyCriterion<K> criterion, final OnNamespaceItemAdded listener) { final Optional<Entry<K, V>> optMatch = getFromNamespace(type, criterion); checkState(optMatch.isPresent(), "Failed to find a match for criterion %s in namespace %s node %s", criterion, type, this); final Entry<K, V> match = optMatch.get(); listener.namespaceItemAdded(StatementContextBase.this, type, match.getKey(), match.getValue()); }
final <K, V, N extends IdentifierNamespace<K, V>> void onNamespaceItemAddedAction(final Class<N> type, final ModelProcessingPhase phase, final NamespaceKeyCriterion<K> criterion, final OnNamespaceItemAdded listener) { final Optional<Entry<K, V>> existing = getFromNamespace(type, criterion); if (existing.isPresent()) { final Entry<K, V> entry = existing.get(); LOG.debug("Listener on {} criterion {} found a pre-existing match: {}", type, criterion, entry); waitForPhase(entry.getValue(), type, phase, criterion, listener); return; } final NamespaceBehaviourWithListeners<K, V, N> behaviour = getBehaviour(type); behaviour.addListener(new PredicateValueAddedListener<K, V>(this) { @Override boolean onValueAdded(final K key, final V value) { if (criterion.match(key)) { LOG.debug("Listener on {} criterion {} matched added key {}", type, criterion, key); waitForPhase(value, type, phase, criterion, listener); return true; } return false; } }); }
final <K, V, N extends IdentifierNamespace<K, V>> void onNamespaceItemAddedAction(final Class<N> type, final K key, final OnNamespaceItemAdded listener) { final Object potential = getFromNamespace(type, key); if (potential != null) { LOG.trace("Listener on {} key {} satisfied immediately", type, key); listener.namespaceItemAdded(this, type, key, potential); return; } getBehaviour(type).addListener(new KeyedValueAddedListener<K>(this, key) { @Override void onValueAdded(final Object value) { listener.namespaceItemAdded(StatementContextBase.this, type, key, value); } }); }
|| Boolean.TRUE.equals(parent.getFromNamespace(AugmentToChoiceNamespace.class, parent))) && isSupportedAsShorthandCase()) { path = parentPath.createChild(qname);
final Set<QName> supportedFeatures = getFromNamespace(SupportedFeaturesNamespace.class, SupportedFeatures.SUPPORTED_FEATURES); final boolean ret = supportedFeatures == null ? true