Add the ability to retain DeclarationReference
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / source / ImplicitSubstatement.java
index c1455e0d5c8a57bc89154a0b6c484770bcfdb257..276f54d7eabe40f8791062ea07b778a4a152c60b 100644 (file)
@@ -10,17 +10,15 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 import static java.util.Objects.requireNonNull;
 
 import com.google.common.annotations.Beta;
-import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
+import org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference;
+import org.opendaylight.yangtools.yang.model.api.meta.StatementOrigin;
 
 /**
- * An implicit sub-statement, which is implied to be always present in its parent, even if it does not appear
- * in model source.
- *
- * @author Robert Varga
+ * An implicit sub-statement, which is implied to be always present in its parent, even if it does not appear in model
+ * source.
  */
 @Beta
-public final class ImplicitSubstatement implements StatementSourceReference {
-
+public final class ImplicitSubstatement extends StatementSourceReference {
     private final StatementSourceReference parentRef;
 
     private ImplicitSubstatement(final StatementSourceReference parentRef) {
@@ -39,8 +37,13 @@ public final class ImplicitSubstatement implements StatementSourceReference {
     }
 
     @Override
-    public StatementSource getStatementSource() {
-        return StatementSource.CONTEXT;
+    public StatementOrigin statementOrigin() {
+        return StatementOrigin.CONTEXT;
+    }
+
+    @Override
+    public DeclarationReference declarationReference() {
+        return null;
     }
 
     @Override