Revert "Revert "Updated SchemaNodeIdentifier namespace handling.""
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / StatusStatementImpl.java
1 /**
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
9
10 import org.opendaylight.yangtools.yang.model.api.Status;
11
12 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.StatusEffectiveStatementImpl;
13 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
14 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.StatusStatement;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
19
20 public class StatusStatementImpl extends AbstractDeclaredStatement<Status>
21         implements StatusStatement {
22
23     protected StatusStatementImpl(
24             StmtContext<Status, StatusStatement, ?> context) {
25         super(context);
26     }
27
28     public static class Definition
29             extends
30             AbstractStatementSupport<Status, StatusStatement, EffectiveStatement<Status, StatusStatement>> {
31
32         public Definition() {
33             super(Rfc6020Mapping.STATUS);
34         }
35
36         @Override
37         public Status parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
38             return Utils.parseStatus(value);
39         }
40
41         @Override
42         public StatusStatement createDeclared(
43                 StmtContext<Status, StatusStatement, ?> ctx) {
44             return new StatusStatementImpl(ctx);
45         }
46
47         @Override
48         public EffectiveStatement<Status, StatusStatement> createEffective(
49                 StmtContext<Status, StatusStatement, EffectiveStatement<Status, StatusStatement>> ctx) {
50             return new StatusEffectiveStatementImpl(ctx);
51         }
52     }
53
54     @Override
55     public Status getValue() {
56         return argument();
57     }
58
59 }