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.model.api.Rfc6020Mapping;
11 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
12 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.ReferenceStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.RefineStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
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 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
21 import javax.annotation.Nullable;
23 public class RefineStatementImpl extends AbstractDeclaredStatement<SchemaNodeIdentifier> implements RefineStatement {
25 protected RefineStatementImpl(
26 StmtContext<SchemaNodeIdentifier, RefineStatement, ?> context) {
30 public static class Definition extends
31 AbstractStatementSupport<SchemaNodeIdentifier, RefineStatement, EffectiveStatement<SchemaNodeIdentifier, RefineStatement>> {
34 super(Rfc6020Mapping.REFINE);
38 public SchemaNodeIdentifier parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) throws SourceException {
39 return SchemaNodeIdentifier.create(Utils.parseXPath(ctx, value), Utils.isXPathAbsolute(value));
43 public RefineStatement createDeclared(StmtContext<SchemaNodeIdentifier, RefineStatement, ?> ctx) {
44 return new RefineStatementImpl(ctx);
48 public EffectiveStatement<SchemaNodeIdentifier, RefineStatement> createEffective(StmtContext<SchemaNodeIdentifier, RefineStatement, EffectiveStatement<SchemaNodeIdentifier, RefineStatement>> ctx) {
49 throw new UnsupportedOperationException();
54 public String getTargetNode() {
60 public DescriptionStatement getDescription() {
61 return firstDeclared(DescriptionStatement.class);
66 public ReferenceStatement getReference() {
67 return firstDeclared(ReferenceStatement.class);