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.parser.stmt.rfc6020.effective.RefineEffectiveStatementImpl;
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.spi.source.SourceException;
22 import javax.annotation.Nullable;
24 public class RefineStatementImpl extends AbstractDeclaredStatement<SchemaNodeIdentifier> implements RefineStatement {
26 protected RefineStatementImpl(
27 StmtContext<SchemaNodeIdentifier, RefineStatement, ?> context) {
31 public static class Definition extends
32 AbstractStatementSupport<SchemaNodeIdentifier, RefineStatement, EffectiveStatement<SchemaNodeIdentifier, RefineStatement>> {
35 super(Rfc6020Mapping.REFINE);
39 public SchemaNodeIdentifier parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) throws SourceException {
40 return SchemaNodeIdentifier.create(Utils.parseXPath(ctx, value), Utils.isXPathAbsolute(value));
44 public RefineStatement createDeclared(StmtContext<SchemaNodeIdentifier, RefineStatement, ?> ctx) {
45 return new RefineStatementImpl(ctx);
49 public EffectiveStatement<SchemaNodeIdentifier, RefineStatement> createEffective(StmtContext<SchemaNodeIdentifier, RefineStatement, EffectiveStatement<SchemaNodeIdentifier, RefineStatement>> ctx) {
50 return new RefineEffectiveStatementImpl(ctx);
55 public String getTargetNode() {
61 public DescriptionStatement getDescription() {
62 return firstDeclared(DescriptionStatement.class);
67 public ReferenceStatement getReference() {
68 return firstDeclared(ReferenceStatement.class);