Propagate @Nonnull and @Nullable annotations
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / AbstractStatementSupport.java
index b0c23ea3c5ea83c4dd1463285279089da4df460d..3fb3758f32fd40d56bce45c4f03bbafc6d3a9119 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.yangtools.yang.parser.spi.meta;
 
 import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
@@ -38,6 +39,7 @@ public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>
         this.type = Preconditions.checkNotNull(publicDefinition);
     }
 
+    @Nonnull
     @Override
     public final QName getStatementName() {
         return type.getStatementName();
@@ -48,13 +50,15 @@ public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>
         return type.getArgumentName();
     }
 
+    @Nonnull
     @Override
     public final Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass() {
         return type.getDeclaredRepresentationClass();
     }
 
+    @Nonnull
     @Override
-    public final Class<? extends DeclaredStatement<?>> getEffectiveRepresentationClass() {
+    public final Class<? extends EffectiveStatement<?,?>> getEffectiveRepresentationClass() {
         return type.getEffectiveRepresentationClass();
     }
 
@@ -81,7 +85,7 @@ public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>
      *
      */
     @Override
-    public void onLinkageDeclared(StmtContext.Mutable<A, D, E> stmt) throws InferenceException, SourceException {
+    public void onPreLinkageDeclared(StmtContext.Mutable<A, D, E> stmt) {
         // NOOP for most implementations
     }
 
@@ -95,8 +99,7 @@ public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>
      *
      */
     @Override
-    public void onStatementDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws InferenceException,
-            SourceException {
+    public void onLinkageDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException {
         // NOOP for most implementations
     }
 
@@ -110,8 +113,26 @@ public abstract class AbstractStatementSupport<A, D extends DeclaredStatement<A>
      *
      */
     @Override
-    public void onFullDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws InferenceException, SourceException {
+    public void onStatementDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException {
         // NOOP for most implementations
     }
 
+    /**
+     *
+     * {@inheritDoc}
+     *
+     * Subclasses of this class may override this method to perform actions on
+     * this event or register modification action using
+     * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
+     *
+     */
+    @Override
+    public void onFullDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException {
+        // NOOP for most implementations
+    }
+
+    @Override
+    public boolean isArgumentYinElement() {
+        return getPublicView().isArgumentYinElement();
+    }
 }