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.description;
10 import com.google.common.collect.ImmutableList;
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.DescriptionEffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.DescriptionStatement;
15 import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.BaseStringStatementSupport;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
19 public final class DescriptionStatementSupport
20 extends BaseStringStatementSupport<DescriptionStatement, DescriptionEffectiveStatement> {
21 private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(
22 YangStmtMapping.DESCRIPTION).build();
23 private static final DescriptionStatementSupport INSTANCE = new DescriptionStatementSupport();
25 private DescriptionStatementSupport() {
26 super(YangStmtMapping.DESCRIPTION);
29 public static DescriptionStatementSupport getInstance() {
34 public String parseArgumentValue(final StmtContext<?, ?, ?> ctx, final String value) {
39 public DescriptionStatement createDeclared(final StmtContext<String, DescriptionStatement, ?> ctx) {
40 return new DescriptionStatementImpl(ctx);
44 protected SubstatementValidator getSubstatementValidator() {
45 return SUBSTATEMENT_VALIDATOR;
49 protected DescriptionEffectiveStatement createEffective(
50 final StmtContext<String, DescriptionStatement, DescriptionEffectiveStatement> ctx,
51 final DescriptionStatement declared,
52 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
53 return new RegularDescriptionEffectiveStatement(declared, substatements);
57 protected DescriptionEffectiveStatement createEmptyEffective(
58 final StmtContext<String, DescriptionStatement, DescriptionEffectiveStatement> ctx,
59 final DescriptionStatement declared) {
60 return new EmptyDescriptionEffectiveStatement(declared);