Bug 4662: Introduce a SemanticVersion concept - pre-linkage phase
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / StatementSupport.java
index 588974fcb0faaf21f26b95438b3b3beda3e9943c..c16b1c283098cff27c49193c4f2e81a5b8d3e39e 100644 (file)
@@ -28,29 +28,34 @@ import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
  * @param <E>
  *            Effective Statement representation
  */
-public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>> extends StatementDefinition, StatementFactory<A, D, E> {
+public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>> extends
+        StatementDefinition, StatementFactory<A, D, E> {
 
     /**
-     * Returns public statement definition, which will be present in builded statements.
+     * Returns public statement definition, which will be present in builded
+     * statements.
      *
-     * Public statement definition may be used to provide different implementation
-     * of statement definition, which will not retain any build specific data
-     * or context.
+     * Public statement definition may be used to provide different
+     * implementation of statement definition, which will not retain any build
+     * specific data or context.
      *
-     * @return public statement definition, which will be present in builded statements.
+     * @return public statement definition, which will be present in builded
+     *         statements.
      */
-     StatementDefinition getPublicView();
+    StatementDefinition getPublicView();
 
     /**
      *
      * Parses textual representation of argument in object representation.
      *
-     * @param ctx Context, which may be used to access source-specific namespaces
-     * required for parsing.
-     * @param value String representation of value, as was present in text source.
+     * @param ctx
+     *            Context, which may be used to access source-specific
+     *            namespaces required for parsing.
+     * @param value
+     *            String representation of value, as was present in text source.
      * @return Parsed value
      */
-     A parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) throws SourceException;
+    A parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) throws SourceException;
 
     /**
      *
@@ -59,16 +64,28 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      * @param stmt
      *            Context of added statement. No substatement are available.
      */
-     void onStatementAdded(StmtContext.Mutable<A, D, E> stmt);
+    void onStatementAdded(StmtContext.Mutable<A, D, E> stmt);
 
     /**
      *
      * Invoked when statement is closed during
-     * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase.
+     * {@link ModelProcessingPhase#SOURCE_PRE_LINKAGE} phase, only substatements
+     * from this and previous phase are available.
+     *
+     * Implementation may use method to perform actions on this event or
+     * register modification action using
+     * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
+     *
+     * @param stmt
+     *            Context of added statement.
+     */
+    void onPreLinkageDeclared(StmtContext.Mutable<A, D, E> stmt);
+
+    /**
      *
      * Invoked when statement is closed during
-     * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase, only substatements from
-     * this and previous phase are available.
+     * {@link ModelProcessingPhase#SOURCE_LINKAGE} phase, only substatements
+     * from this and previous phase are available.
      *
      * Implementation may use method to perform actions on this event or
      * register modification action using
@@ -77,7 +94,7 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      * @param stmt
      *            Context of added statement.
      */
-     void onLinkageDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
+    void onLinkageDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
 
     /**
      *
@@ -85,8 +102,8 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase.
      *
      * Invoked when statement is closed during
-     * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase, only substatements from
-     * this phase are available.
+     * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase, only
+     * substatements from this phase are available.
      *
      * Implementation may use method to perform actions on this event or
      * register modification action using
@@ -96,7 +113,7 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      *            Context of added statement. Argument and statement parent is
      *            accessible.
      */
-     void onStatementDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
+    void onStatementDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
 
     /**
      *
@@ -116,6 +133,5 @@ public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends E
      *            Context of added statement. Argument and statement parent is
      *            accessible.
      */
-     void onFullDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
-
+    void onFullDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
 }
\ No newline at end of file