Bug 2361: Added meta-level SPI for building any statement-based models.
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / ModelProcessingPhase.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.parser.spi.meta;
9
10 import javax.annotation.Nullable;
11
12 public enum ModelProcessingPhase {
13
14     /**
15      *
16      * Cross-source relationship resolution phase.
17      * <p>
18      * In this phase of processing only statements which affects
19      * cross-source relationship (e.g. imports / includes)
20      * are processed.
21      * <p>
22      * At end of this phase all source related contexts should
23      * be bind to their imports and includes to allow
24      * visibility of custom defined statements in following
25      * phases.
26      */
27     SourceLinkage(null),
28     StatementDefinition(SourceLinkage),
29     FullDeclaration(StatementDefinition),
30     EffectiveModel(FullDeclaration);
31
32
33     private final ModelProcessingPhase previousPhase;
34
35     private ModelProcessingPhase(@Nullable ModelProcessingPhase previous) {
36         this.previousPhase = previous;
37     }
38
39     public ModelProcessingPhase getPreviousPhase() {
40         return previousPhase;
41     }
42
43 }