Bug 2156: Unsupported augment target
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / builder / impl / AugmentationSchemaBuilderImpl.java
index 5d93a06579bea94c8ead4cea608b422dfab68b78..83dffd946273afa530b4bba08baeb541e866eb60 100644 (file)
@@ -37,6 +37,8 @@ public final class AugmentationSchemaBuilderImpl extends AbstractDocumentedDataN
     private final SchemaPath targetPath;
 
     private boolean resolved;
+    private boolean unsupportedTarget = false;
+
     private AugmentationSchemaBuilder copyOf;
 
     public AugmentationSchemaBuilderImpl(final String moduleName, final int line, final String augmentTargetStr,
@@ -110,6 +112,24 @@ public final class AugmentationSchemaBuilderImpl extends AbstractDocumentedDataN
         this.resolved = resolved;
     }
 
+    /**
+     *  Set true if target of augment is unsupported (e.g. node in body of extension).
+     *  In such case, augmentation is skipped and AugmentationSchema is not built.
+     */
+    @Override
+    public void setUnsupportedTarget(boolean unsupportedTarget) {
+        this.unsupportedTarget = unsupportedTarget;
+    }
+
+    /**
+     *  Return true if target of augment is unsupported (e.g. node in body of extension).
+     *  In such case, augmentation is skipped and AugmentationSchema is not built.
+     */
+    @Override
+    public boolean isUnsupportedTarget() {
+        return unsupportedTarget;
+    }
+
     @Override
     public String getWhenCondition() {
         return whenCondition;