*/
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;
// :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() {