2 * Copyright (c) 2015 Cisco Systems, Inc. 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.spi.meta;
10 import java.util.stream.Stream;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
16 * An entity capable of creating {@link DeclaredStatement} and {@link EffectiveStatement} instances for a particular
17 * type. This interface is usually realized as an implementation-specific combination with {@link StatementSupport}.
19 * @param <A> Argument type
20 * @param <D> Declared Statement representation
21 * @param <E> Effective Statement representation
23 public interface StatementFactory<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>> {
25 * Create a {@link DeclaredStatement} for specified context.
27 * @param ctx Statement context
28 * @return A declared statement instance.
30 @NonNull D createDeclared(@NonNull StmtContext<A, D, ?> ctx);
33 * Create a {@link EffectiveStatement} for specified context.
35 * @param stmt Effective capture of this statement's significant state
36 * @return An effective statement instance
38 @NonNull E createEffective(EffectiveStmtCtx.@NonNull Current<A, D> stmt,
39 Stream<? extends StmtContext<?, ?, ?>> declaredSubstatements,
40 Stream<? extends StmtContext<?, ?, ?>> effectiveSubstatements);