Fix uses/augment linkage
[mdsal.git] / binding / mdsal-binding-generator / src / main / java / org / opendaylight / mdsal / binding / generator / impl / reactor / ModuleAugmentGenerator.java
index f4c01a3e7e0f38bab1a9135925e0eb0620033a9b..ee590e72bf2db69aabe15d06229d3b18be0489e9 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.mdsal.binding.generator.impl.reactor;
 
+import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.stmt.AugmentEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
 
 /**
  * Generator corresponding to a {@code augment} statement used as a child of a {@code module} statement.
@@ -18,14 +18,8 @@ final class ModuleAugmentGenerator extends AbstractAugmentGenerator {
         super(statement, parent);
     }
 
-    @Override
-    void loadTargetGenerator() {
-        throw new UnsupportedOperationException();
-    }
-
-    void linkAugmentationTarget(final GeneratorContext context) {
-        final SchemaNodeIdentifier path = statement().argument();
-        final ModuleGenerator module = context.resolveModule(path.firstNodeIdentifier().getModule());
-        setTargetGenerator(module.resolveSchemaNode(path));
+    @NonNull AugmentRequirement startLinkage(final GeneratorContext context) {
+        return new AugmentRequirement(this,
+            context.resolveModule(statement().argument().firstNodeIdentifier().getModule()));
     }
 }