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.common.QName;
11 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.BitStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.PositionStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
20 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
21 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.BitEffectiveStatementImpl;
23 public class BitStatementImpl extends AbstractDeclaredStatement<QName> implements BitStatement {
25 protected BitStatementImpl(StmtContext<QName, BitStatement, ?> context) {
29 public static class Definition extends
30 AbstractStatementSupport<QName, BitStatement, EffectiveStatement<QName, BitStatement>> {
33 super(Rfc6020Mapping.BIT);
37 public QName parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
38 return Utils.qNameFromArgument(ctx, value);
42 public BitStatement createDeclared(StmtContext<QName, BitStatement, ?> ctx) {
43 return new BitStatementImpl(ctx);
47 public EffectiveStatement<QName, BitStatement> createEffective(
48 StmtContext<QName, BitStatement, EffectiveStatement<QName, BitStatement>> ctx) {
49 return new BitEffectiveStatementImpl(ctx);
55 public StatusStatement getStatus() {
56 return firstDeclared(StatusStatement.class);
60 public DescriptionStatement getDescription() {
61 return firstDeclared(DescriptionStatement.class);
65 public ReferenceStatement getReference() {
66 return firstDeclared(ReferenceStatement.class);
70 public String getName() {
71 return argument().getLocalName();
75 public PositionStatement getPosition() {
76 return firstDeclared(PositionStatement.class);