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
9 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
11 import javax.annotation.Nullable;
12 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
16 import org.opendaylight.yangtools.yang.model.api.stmt.RefineStatement;
17 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
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.RefineEffectiveStatementImpl;
23 public class RefineStatementImpl extends AbstractDeclaredStatement<SchemaNodeIdentifier> implements RefineStatement {
25 protected RefineStatementImpl(final StmtContext<SchemaNodeIdentifier, RefineStatement, ?> context) {
29 public static class Definition extends
30 AbstractStatementSupport<SchemaNodeIdentifier, RefineStatement, EffectiveStatement<SchemaNodeIdentifier, RefineStatement>> {
33 super(Rfc6020Mapping.REFINE);
37 public SchemaNodeIdentifier parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
38 return Utils.nodeIdentifierFromPath(ctx, value);
42 public RefineStatement createDeclared(final StmtContext<SchemaNodeIdentifier, RefineStatement, ?> ctx) {
43 return new RefineStatementImpl(ctx);
47 public EffectiveStatement<SchemaNodeIdentifier, RefineStatement> createEffective(
48 final StmtContext<SchemaNodeIdentifier, RefineStatement, EffectiveStatement<SchemaNodeIdentifier, RefineStatement>> ctx) {
49 return new RefineEffectiveStatementImpl(ctx);
54 public String getTargetNode() {
60 public DescriptionStatement getDescription() {
61 return firstDeclared(DescriptionStatement.class);
66 public ReferenceStatement getReference() {
67 return firstDeclared(ReferenceStatement.class);