Fix checkstyle in yang-parser-spi
[yangtools.git] / yang / yang-parser-spi / 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     INIT(null),
14
15     /**
16      * Preliminary cross-source relationship resolution phase which collects
17      * available module names and module namespaces. It is necessary in order to
18      * correct resolution of unknown statements used in linkage phase (e.g.
19      * semantic version of yang modules).
20      */
21     SOURCE_PRE_LINKAGE(INIT),
22
23     /**
24      * Cross-source relationship resolution phase.
25      *
26      * <p>
27      * In this phase of processing only statements which affects cross-source relationship (e.g. imports / includes)
28      * are processed.
29      *
30      * <p>
31      * At end of this phase all source related contexts should be bind to their imports and includes to allow
32      * visibility of custom defined statements in subsequent phases.
33      */
34     SOURCE_LINKAGE(SOURCE_PRE_LINKAGE),
35     STATEMENT_DEFINITION(SOURCE_LINKAGE),
36     FULL_DECLARATION(STATEMENT_DEFINITION),
37     EFFECTIVE_MODEL(FULL_DECLARATION);
38
39     private final ModelProcessingPhase previousPhase;
40
41     ModelProcessingPhase(@Nullable ModelProcessingPhase previous) {
42         this.previousPhase = previous;
43     }
44
45     public ModelProcessingPhase getPreviousPhase() {
46         return previousPhase;
47     }
48 }