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.SubstatementValidator;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
15 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
18 * StatementSupport for statements defined via YANG extensions. This is implemented by piggy-backing
19 * to a {@link UnknownStatementImpl.Definition}.
21 * @author Robert Varga
23 public final class ModelDefinedStatementSupport extends AbstractStatementSupport<String,
24 UnknownStatement<String>, EffectiveStatement<String, UnknownStatement<String>>> {
25 private final UnknownStatementImpl.Definition definition;
27 ModelDefinedStatementSupport(final ModelDefinedStatementDefinition publicDefinition) {
28 super(publicDefinition);
29 this.definition = new UnknownStatementImpl.Definition(publicDefinition);
33 public UnknownStatement<String> createDeclared(final StmtContext<String, UnknownStatement<String>, ?> ctx) {
34 return definition.createDeclared(ctx);
38 public EffectiveStatement<String, UnknownStatement<String>> createEffective(
39 final StmtContext<String, UnknownStatement<String>, EffectiveStatement<String, UnknownStatement<String>>> ctx) {
40 return definition.createEffective(ctx);
44 public String parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) throws SourceException {
45 return definition.parseArgumentValue(ctx, value);
49 protected SubstatementValidator getSubstatementValidator() {