2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.util;
11 import org.opendaylight.yangtools.yang.common.QName;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
13 import org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode;
14 import org.opendaylight.yangtools.yang.model.api.AugmentationTarget;
15 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
16 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
17 import org.opendaylight.yangtools.yang.model.util.EffectiveAugmentationSchema;
18 import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack;
20 final class AugmentationContextNode extends DataContainerContextNode<AugmentationIdentifier> {
21 AugmentationContextNode(final AugmentationSchemaNode augmentation, final DataNodeContainer target) {
22 super(augmentationIdentifierFrom(augmentation), new EffectiveAugmentationSchema(augmentation, target), null);
26 public boolean isMixin() {
31 protected DataSchemaContextNode<?> fromLocalSchemaAndQName(final DataNodeContainer schema, final QName child) {
32 final DataSchemaNode result = findChildSchemaNode(schema, child);
33 // We try to look up if this node was added by augmentation
34 if (schema instanceof DataSchemaNode && result.isAugmenting()) {
35 return fromAugmentation(schema, (AugmentationTarget) schema, result);
37 return lenientOf(result);
41 protected Set<QName> getQNameIdentifiers() {
42 return getIdentifier().getPossibleChildNames();
46 protected void pushToStack(final SchemaInferenceStack stack) {