2 * Copyright (c) 2016 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.parser.rfc7950.stmt.action;
10 import org.opendaylight.yangtools.yang.common.QName;
11 import org.opendaylight.yangtools.yang.model.api.ActionDefinition;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.ActionEffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.ActionStatement;
15 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.AbstractEffectiveOperationDefinition;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.CopyHistory;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.CopyType;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
20 final class ActionEffectiveStatementImpl extends AbstractEffectiveOperationDefinition<ActionStatement>
21 implements ActionDefinition, ActionEffectiveStatement {
22 private final boolean augmenting;
23 private final boolean addedByUses;
25 ActionEffectiveStatementImpl(
26 final StmtContext<QName, ActionStatement, EffectiveStatement<QName, ActionStatement>> ctx) {
30 final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory();
31 if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) {
32 this.augmenting = true;
33 this.addedByUses = true;
35 this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION);
36 this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES);
42 public boolean isAugmenting() {
48 public boolean isAddedByUses() {