2 * Copyright (c) 2016 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.rfc7950.stmt.module;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.openconfig.model.api.OpenConfigStatements;
12 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
16 public final class ModuleStatementRFC7950Support extends AbstractModuleStatementSupport {
17 private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(YangStmtMapping
19 .addAny(YangStmtMapping.ANYDATA)
20 .addAny(YangStmtMapping.ANYXML)
21 .addAny(YangStmtMapping.AUGMENT)
22 .addAny(YangStmtMapping.CHOICE)
23 .addOptional(YangStmtMapping.CONTACT)
24 .addAny(YangStmtMapping.CONTAINER)
25 .addOptional(YangStmtMapping.DESCRIPTION)
26 .addAny(YangStmtMapping.DEVIATION)
27 .addAny(YangStmtMapping.EXTENSION)
28 .addAny(YangStmtMapping.FEATURE)
29 .addAny(YangStmtMapping.GROUPING)
30 .addAny(YangStmtMapping.IDENTITY)
31 .addAny(YangStmtMapping.IMPORT)
32 .addAny(YangStmtMapping.INCLUDE)
33 .addAny(YangStmtMapping.LEAF)
34 .addAny(YangStmtMapping.LEAF_LIST)
35 .addAny(YangStmtMapping.LIST)
36 .addMandatory(YangStmtMapping.NAMESPACE)
37 .addAny(YangStmtMapping.NOTIFICATION)
38 .addOptional(YangStmtMapping.ORGANIZATION)
39 .addMandatory(YangStmtMapping.PREFIX)
40 .addOptional(YangStmtMapping.REFERENCE)
41 .addAny(YangStmtMapping.REVISION)
42 .addAny(YangStmtMapping.RPC)
43 .addAny(YangStmtMapping.TYPEDEF)
44 .addAny(YangStmtMapping.USES)
45 .addMandatory(YangStmtMapping.YANG_VERSION)
46 .addOptional(OpenConfigStatements.OPENCONFIG_VERSION)
48 private static final ModuleStatementRFC7950Support INSTANCE = new ModuleStatementRFC7950Support();
50 private ModuleStatementRFC7950Support() {
54 public static ModuleStatementRFC7950Support getInstance() {
59 protected SubstatementValidator getSubstatementValidator() {
60 return SUBSTATEMENT_VALIDATOR;