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.model.api.stmt.SchemaTreeEffectiveStatement;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
21 * Specialization of {@link BaseQNameStatementSupport} for {@code input} and {@code output} statements.
23 * @param <D> Declared Statement representation
24 * @param <E> Effective Statement representation
27 public abstract class BaseOperationContainerStatementSupport<D extends DeclaredStatement<QName>,
28 E extends SchemaTreeEffectiveStatement<D>> extends BaseImplicitStatementSupport<D, E> {
29 protected BaseOperationContainerStatementSupport(final StatementDefinition publicDefinition) {
30 super(publicDefinition);
34 protected final @NonNull E createDeclaredEffective(final StmtContext<QName, D, E> ctx,
35 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements, final D declared) {
36 return createDeclaredEffective(historyAndStatusFlags(ctx, substatements), ctx, substatements, declared);
39 protected abstract @NonNull E createDeclaredEffective(int flags, @NonNull StmtContext<QName, D, E> ctx,
40 @NonNull ImmutableList<? extends EffectiveStatement<?, ?>> substatements, @NonNull D declared);
43 protected final E createUndeclaredEffective(final StmtContext<QName, D, E> ctx,
44 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
45 return createUndeclaredEffective(historyAndStatusFlags(ctx, substatements), ctx, substatements);
48 protected abstract @NonNull E createUndeclaredEffective(int flags, @NonNull StmtContext<QName, D, E> ctx,
49 @NonNull ImmutableList<? extends EffectiveStatement<?, ?>> substatements);