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 java.util.Collection;
11 import org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureStatement;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
15 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
18 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
19 import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
20 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
21 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
22 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
24 public class FeatureStatementImpl extends AbstractDeclaredStatement<QName>
25 implements FeatureStatement {
27 protected FeatureStatementImpl(
28 StmtContext<QName, FeatureStatement, ?> context) {
32 public static class Definition
34 AbstractStatementSupport<QName, FeatureStatement, EffectiveStatement<QName, FeatureStatement>> {
37 super(Rfc6020Mapping.FEATURE);
41 public QName parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
42 return Utils.qNameFromArgument(ctx, value);
46 public FeatureStatement createDeclared(
47 StmtContext<QName, FeatureStatement, ?> ctx) {
48 return new FeatureStatementImpl(ctx);
52 public EffectiveStatement<QName, FeatureStatement> createEffective(
53 StmtContext<QName, FeatureStatement, EffectiveStatement<QName, FeatureStatement>> ctx) {
54 throw new UnsupportedOperationException();
60 public StatusStatement getStatus() {
61 return firstDeclared(StatusStatement.class);
65 public DescriptionStatement getDescription() {
66 return firstDeclared(DescriptionStatement.class);
70 public ReferenceStatement getReference() {
71 return firstDeclared(ReferenceStatement.class);
75 public Collection<? extends IfFeatureStatement> getIfFeatures() {
76 return allDeclared(IfFeatureStatement.class);
80 public QName getName() {