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;
14 * Reference of statement source
16 * Statement source reference serves to provide information, why
17 * statement was defined and introduced in model.
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}.
24 public interface StatementSourceReference {
30 * @return {@link StatementSource#DECLARATION} if statement was explicitly
31 * declared in YANG model source, {@link StatementSource#CONTEXT} if statement
34 StatementSource getStatementSource();
37 * Returns human readable representation of statement source.
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.
43 * @return human readable representation of statement source.