2 * Copyright (c) 2015 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.stmt.rfc6020;
10 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.NotificationEffectiveStatementImpl;
12 import javax.annotation.Nullable;
13 import java.util.Collection;
14 import org.opendaylight.yangtools.yang.model.api.stmt.DataDefinitionStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.GroupingStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
19 import org.opendaylight.yangtools.yang.model.api.stmt.TypedefStatement;
20 import org.opendaylight.yangtools.yang.common.QName;
21 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
22 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
23 import org.opendaylight.yangtools.yang.model.api.stmt.NotificationStatement;
24 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
25 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
26 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
28 public class NotificationStatementImpl extends AbstractDeclaredStatement<QName>
29 implements NotificationStatement {
31 protected NotificationStatementImpl(
32 StmtContext<QName, NotificationStatement, ?> context) {
36 public static class Definition
38 AbstractStatementSupport<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> {
41 super(Rfc6020Mapping.NOTIFICATION);
45 public QName parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
46 return Utils.qNameFromArgument(ctx, value);
50 public NotificationStatement createDeclared(
51 StmtContext<QName, NotificationStatement, ?> ctx) {
52 return new NotificationStatementImpl(ctx);
56 public EffectiveStatement<QName, NotificationStatement> createEffective(
57 StmtContext<QName, NotificationStatement, EffectiveStatement<QName, NotificationStatement>> ctx) {
58 return new NotificationEffectiveStatementImpl(ctx);
64 public QName getName() {
69 public Collection<? extends TypedefStatement> getTypedefs() {
70 return allDeclared(TypedefStatement.class);
74 public Collection<? extends GroupingStatement> getGroupings() {
75 return allDeclared(GroupingStatement.class);
79 public Collection<? extends DataDefinitionStatement> getDataDefinitions() {
80 return allDeclared(DataDefinitionStatement.class);
85 public StatusStatement getStatus() {
86 return firstDeclared(StatusStatement.class);
91 public DescriptionStatement getDescription() {
92 return firstDeclared(DescriptionStatement.class);
97 public ReferenceStatement getReference() {
98 return firstDeclared(ReferenceStatement.class);