2 * Copyright (c) 2021 PANTHEON.tech, 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.odlext.parser;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableList;
12 import org.opendaylight.yangtools.odlext.model.api.MountEffectiveStatement;
13 import org.opendaylight.yangtools.odlext.model.api.MountStatement;
14 import org.opendaylight.yangtools.odlext.model.api.OpenDaylightExtensionsStatements;
15 import org.opendaylight.yangtools.yang.common.Empty;
16 import org.opendaylight.yangtools.yang.model.api.meta.DeclarationReference;
17 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
18 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
19 import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
20 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractEmptyStatementSupport;
21 import org.opendaylight.yangtools.yang.parser.spi.meta.BoundStmtCtx;
22 import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
23 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
26 public final class MountStatementSupport
27 extends AbstractEmptyStatementSupport<MountStatement, MountEffectiveStatement> {
28 private static final SubstatementValidator VALIDATOR =
29 SubstatementValidator.builder(OpenDaylightExtensionsStatements.MOUNT).build();
31 public MountStatementSupport(final YangParserConfiguration config) {
32 super(OpenDaylightExtensionsStatements.MOUNT, StatementPolicy.exactReplica(), config, VALIDATOR);
36 protected MountStatement createDeclared(final BoundStmtCtx<Empty> ctx,
37 final ImmutableList<DeclaredStatement<?>> substatements) {
38 return new MountStatementImpl(substatements);
42 protected MountStatement attachDeclarationReference(final MountStatement stmt,
43 final DeclarationReference reference) {
44 return new RefMountStatement(stmt, reference);
48 protected MountEffectiveStatement createEffective(final Current<Empty, MountStatement> stmt,
49 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
50 return new MountEffectiveStatementImpl(stmt.declared(), substatements);