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