Merge "Add hooking into NormalizedNodeParsers."
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / OutputEffectiveStatementImpl.java
index c6d21e86a7bc6f5a796beedfa687d6b2bc829aaa..0d061e115b260b861d0c0fcdbe095e602a6e9242 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective;
 
+import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.TypeOfCopy;
+
 import java.util.HashSet;
 import java.util.LinkedList;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils;
-
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 import java.util.List;
@@ -54,6 +55,27 @@ public class OutputEffectiveStatementImpl extends
         // :TODO init other fields
 
         initSubstatementCollections();
+        initCopyType(ctx);
+    }
+
+    private void initCopyType(
+            StmtContext<QName, OutputStatement, EffectiveStatement<QName, OutputStatement>> ctx) {
+
+        TypeOfCopy typeOfCopy = ctx.getTypeOfCopy();
+        switch (typeOfCopy) {
+        case ADDED_BY_AUGMENTATION:
+            augmenting = true;
+            original = (ContainerSchemaNode) ctx.getOriginalCtx()
+                    .buildEffective();
+            break;
+        case ADDED_BY_USES:
+            addedByUses = true;
+            original = (ContainerSchemaNode) ctx.getOriginalCtx()
+                    .buildEffective();
+            break;
+        default:
+            break;
+        }
     }
 
     private void initSubstatementCollections() {