2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.parser.spi.source;
10 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
13 * Reference of statement source. Statement source reference serves to provide information, why a statement was defined
14 * and introduced in model.
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}.
20 public interface StatementSourceReference {
22 * Returns source type.
24 * @return {@link StatementSource#DECLARATION} if statement was explicitly
25 * declared in YANG model source, {@link StatementSource#CONTEXT} if statement
28 StatementSource getStatementSource();
31 * Returns human readable representation of statement source.
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.
38 * @return human readable representation of statement source.