Populate xpath/ hierarchy
[yangtools.git] / parser / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / ImplicitParentAwareStatementSupport.java
1 /*
2  * Copyright (c) 2018 Pantheon Technologies, 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 java.util.Optional;
12 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
13
14 /**
15  * {@link StatementSupport} trait for statements which create intermediate parent node for some of its child nodes.
16  * An example of this is RFC6020/RFC7950 choice statement, which creates implicit case statements for child containers
17  * and others.
18  *
19  * @author Robert Varga
20  */
21 @Beta
22 public interface ImplicitParentAwareStatementSupport {
23     /**
24      * Returns implicit parent statement support for supplied statement definition, if it is defined. This allows
25      * implementations of this interface add implicit parent to the build context hierarchy before a substatement
26      * is created.
27      *
28      * @param stmtDef statement definition of substatement
29      * @return optional of implicit parent statement support
30      */
31     Optional<StatementSupport<?, ?, ?>> getImplicitParentFor(StatementDefinition stmtDef);
32 }