2 * Copyright (c) 2020 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.yang.parser.rfc7950.stmt;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableList;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
15 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
16 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
20 * Specialization of {@link BaseQNameStatementSupport} for {@code input} and {@code output} statements.
22 * @param <D> Declared Statement representation
23 * @param <E> Effective Statement representation
26 public abstract class BaseOperationContainerStatementSupport<D extends DeclaredStatement<QName>,
27 E extends EffectiveStatement<QName, D>> extends BaseImplicitStatementSupport<D, E> {
28 protected BaseOperationContainerStatementSupport(final StatementDefinition publicDefinition) {
29 super(publicDefinition);
33 protected final @NonNull E createDeclaredEffective(final StmtContext<QName, D, E> ctx,
34 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements, final D declared) {
35 return createDeclaredEffective(historyAndStatusFlags(ctx, substatements), ctx, substatements, declared);
38 protected abstract @NonNull E createDeclaredEffective(int flags, @NonNull StmtContext<QName, D, E> ctx,
39 @NonNull ImmutableList<? extends EffectiveStatement<?, ?>> substatements, @NonNull D declared);
42 protected final E createUndeclaredEffective(final StmtContext<QName, D, E> ctx,
43 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
44 return createUndeclaredEffective(historyAndStatusFlags(ctx, substatements), ctx, substatements);
47 protected abstract @NonNull E createUndeclaredEffective(int flags, @NonNull StmtContext<QName, D, E> ctx,
48 @NonNull ImmutableList<? extends EffectiveStatement<?, ?>> substatements);