Teach YANG parser to retain DeclarationReference
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / OverrideChildStatementSupport.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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 com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
14
15 /**
16  * An additional trait for {@link StatementSupport}, allowing a parent statement to override the support for a child
17  * statement.
18  */
19 @Beta
20 public interface OverrideChildStatementSupport {
21     /**
22      * Returns unknown statement form of a regular YANG statement supplied as a parameter to the method.
23      *
24      * @param childDef statement definition of a regular YANG statement
25      * @return Optional of unknown statement form of a regular YANG statement, or {@code null} if it should not be
26      *         overridden.
27      */
28     @Nullable StatementSupport<?, ?, ?> statementDefinitionOverrideOf(@NonNull StatementDefinition childDef);
29 }