Populate xpath/ hierarchy
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / augment / AugmentStatementRFC6020Support.java
1 /*
2  * Copyright (c) 2017 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.rfc7950.stmt.augment;
9
10 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
11 import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
12 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
14
15 public final class AugmentStatementRFC6020Support extends AbstractAugmentStatementSupport {
16     private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator
17             .builder(YangStmtMapping.AUGMENT)
18             .addAny(YangStmtMapping.ANYXML)
19             .addAny(YangStmtMapping.CASE)
20             .addAny(YangStmtMapping.CHOICE)
21             .addAny(YangStmtMapping.CONTAINER)
22             .addOptional(YangStmtMapping.DESCRIPTION)
23             .addAny(YangStmtMapping.IF_FEATURE)
24             .addAny(YangStmtMapping.LEAF)
25             .addAny(YangStmtMapping.LEAF_LIST)
26             .addAny(YangStmtMapping.LIST)
27             .addOptional(YangStmtMapping.REFERENCE)
28             .addOptional(YangStmtMapping.STATUS)
29             .addAny(YangStmtMapping.USES)
30             .addOptional(YangStmtMapping.WHEN)
31             .build();
32
33     public AugmentStatementRFC6020Support(final YangParserConfiguration config) {
34         super(config, SUBSTATEMENT_VALIDATOR);
35     }
36
37     @Override
38     boolean allowsMandatory(final StmtContext<?, ?, ?> ctx) {
39         return false;
40     }
41 }