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.FeatureEffectiveStatementImpl;
12 import java.util.Collection;
13 import org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureStatement;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
16 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
19 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
20 import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
21 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
22 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
23 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
25 public class FeatureStatementImpl extends AbstractDeclaredStatement<QName>
26 implements FeatureStatement {
28 protected FeatureStatementImpl(
29 StmtContext<QName, FeatureStatement, ?> context) {
33 public static class Definition
35 AbstractStatementSupport<QName, FeatureStatement, EffectiveStatement<QName, FeatureStatement>> {
38 super(Rfc6020Mapping.FEATURE);
42 public QName parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
43 return Utils.qNameFromArgument(ctx, value);
47 public FeatureStatement createDeclared(
48 StmtContext<QName, FeatureStatement, ?> ctx) {
49 return new FeatureStatementImpl(ctx);
53 public EffectiveStatement<QName, FeatureStatement> createEffective(
54 StmtContext<QName, FeatureStatement, EffectiveStatement<QName, FeatureStatement>> ctx) {
55 return new FeatureEffectiveStatementImpl(ctx);
61 public StatusStatement getStatus() {
62 return firstDeclared(StatusStatement.class);
66 public DescriptionStatement getDescription() {
67 return firstDeclared(DescriptionStatement.class);
71 public ReferenceStatement getReference() {
72 return firstDeclared(ReferenceStatement.class);
76 public Collection<? extends IfFeatureStatement> getIfFeatures() {
77 return allDeclared(IfFeatureStatement.class);
81 public QName getName() {