2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.rfc7950.stmt.augment;
10 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
11 import org.opendaylight.yangtools.yang.model.parser.api.YangParserConfiguration;
12 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
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)
33 public AugmentStatementRFC6020Support(final YangParserConfiguration config) {
38 protected SubstatementValidator getSubstatementValidator() {
39 return SUBSTATEMENT_VALIDATOR;
43 boolean allowsMandatory(final StmtContext<?, ?, ?> ctx) {