2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.rfc7950.stmt.leaf_list;
10 import org.opendaylight.yangtools.yang.common.QName;
11 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.LeafListStatement;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractQNameStatementSupport;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
18 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.ChildSchemaNodes;
19 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.LeafListEffectiveStatementImpl;
21 abstract class AbstractLeafListStatementSupport
22 extends AbstractQNameStatementSupport<LeafListStatement, EffectiveStatement<QName, LeafListStatement>> {
24 AbstractLeafListStatementSupport() {
25 super(YangStmtMapping.LEAF_LIST);
29 public final void onStatementAdded(
30 final Mutable<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> stmt) {
31 stmt.getParentContext().addToNs(ChildSchemaNodes.class, stmt.getStatementArgument(), stmt);
35 public final QName parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
36 return StmtContextUtils.qnameFromArgument(ctx, value);
40 public final LeafListStatement createDeclared(final StmtContext<QName, LeafListStatement, ?> ctx) {
41 return new LeafListStatementImpl(ctx);
45 public final EffectiveStatement<QName, LeafListStatement> createEffective(
46 final StmtContext<QName, LeafListStatement, EffectiveStatement<QName, LeafListStatement>> ctx) {
47 return new LeafListEffectiveStatementImpl(ctx);