b5efed69b2b2c4a5d71e360d38b273268f7a5055
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / source / StatementSourceReference.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.source;
9
10 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
11
12 /**
13  *
14  * Reference of statement source
15  *
16  * Statement source reference serves to provide information, why
17  * statement was defined and introduced in model.
18  *
19  * Reasons for introduction of statement could be various, but
20  * most obvious one is explicit declaration in model source text
21  * such as {@link DeclarationInTextSource}.
22  *
23  */
24 public interface StatementSourceReference {
25
26     /**
27      *
28      * Returns source type
29      *
30      * @return {@link StatementSource#DECLARATION} if statement was explicitly
31      * declared in YANG model source, {@link StatementSource#CONTEXT} if statement
32      * was inferred.
33      */
34     StatementSource getStatementSource();
35
36     /**
37      * Returns human readable representation of statement source.
38      *
39      * Implementations of this interface should override {@link #toString()},
40      * since it may be used in error reporting to provide context
41      * information for model designer to debug errors in its mode.
42      *
43      * @return human readable representation of statement source.
44      */
45     @Override
46     String toString();
47
48 }