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.notification;
10 import org.opendaylight.yangtools.yang.common.QName;
11 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.NotificationStatement;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
17 public final class NotificationStatementRFC6020Support extends AbstractNotificationStatementSupport {
18 private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(
19 YangStmtMapping.NOTIFICATION)
20 .addAny(YangStmtMapping.ANYXML)
21 .addAny(YangStmtMapping.CHOICE)
22 .addAny(YangStmtMapping.CONTAINER)
23 .addOptional(YangStmtMapping.DESCRIPTION)
24 .addAny(YangStmtMapping.GROUPING)
25 .addAny(YangStmtMapping.IF_FEATURE)
26 .addAny(YangStmtMapping.LEAF)
27 .addAny(YangStmtMapping.LEAF_LIST)
28 .addAny(YangStmtMapping.LIST)
29 .addOptional(YangStmtMapping.REFERENCE)
30 .addOptional(YangStmtMapping.STATUS)
31 .addAny(YangStmtMapping.TYPEDEF)
32 .addAny(YangStmtMapping.USES)
34 private static final NotificationStatementRFC6020Support INSTANCE = new NotificationStatementRFC6020Support();
36 private NotificationStatementRFC6020Support() {
40 public static NotificationStatementRFC6020Support getInstance() {
45 public EffectiveStatement<QName, NotificationStatement> createEffective(
46 final StmtContext<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> ctx) {
47 return new NotificationEffectiveStatementImpl(ctx);
51 protected SubstatementValidator getSubstatementValidator() {
52 return SUBSTATEMENT_VALIDATOR;