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.meta.EffectiveStatement;
11 import org.opendaylight.yangtools.yang.model.api.stmt.UnknownStatement;
12 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
14 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
17 * StatementSupport for statements defined via YANG extensions. This is implemented by piggy-backing
18 * to a {@link UnknownStatementImpl.Definition}.
20 * @author Robert Varga
22 public final class ModelDefinedStatementSupport extends AbstractStatementSupport<String,
23 UnknownStatement<String>, EffectiveStatement<String, UnknownStatement<String>>> {
24 private final UnknownStatementImpl.Definition definition;
26 ModelDefinedStatementSupport(final ModelDefinedStatementDefinition publicDefinition) {
27 super(publicDefinition);
28 this.definition = new UnknownStatementImpl.Definition(publicDefinition);
32 public UnknownStatement<String> createDeclared(final StmtContext<String, UnknownStatement<String>, ?> ctx) {
33 return definition.createDeclared(ctx);
37 public EffectiveStatement<String, UnknownStatement<String>> createEffective(
38 final StmtContext<String, UnknownStatement<String>, EffectiveStatement<String, UnknownStatement<String>>> ctx) {
39 return definition.createEffective(ctx);
43 public String parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) throws SourceException {
44 return definition.parseArgumentValue(ctx, value);