Reformulate StatementContextFactory.createEffective()
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / StatementFactory.java
index 458a188ae18ac67852cb692666b09b7bc7cd6a59..f929529c63277cefa8ac569d23af7d34606800e4 100644 (file)
@@ -7,10 +7,19 @@
  */
 package org.opendaylight.yangtools.yang.parser.spi.meta;
 
+import java.util.stream.Stream;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 
+/**
+ * An entity capable of creating {@link DeclaredStatement} and {@link EffectiveStatement} instances for a particular
+ * type. This interface is usually realized as an implementation-specific combination with {@link StatementSupport}.
+ *
+ * @param <A> Argument type
+ * @param <D> Declared Statement representation
+ * @param <E> Effective Statement representation
+ */
 public interface StatementFactory<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>> {
     /**
      * Create a {@link DeclaredStatement} for specified context.
@@ -23,8 +32,10 @@ public interface StatementFactory<A, D extends DeclaredStatement<A>, E extends E
     /**
      * Create a {@link EffectiveStatement} for specified context.
      *
-     * @param ctx Statement context
-     * @return An effective statement instance.
+     * @param stmt Effective capture of this statement's significant state
+     * @return An effective statement instance
      */
-    @NonNull E createEffective(@NonNull StmtContext<A, D, E> ctx);
+    @NonNull E createEffective(EffectiveStmtCtx.@NonNull Current<A, D> stmt,
+        Stream<? extends StmtContext<?, ?, ?>> declaredSubstatements,
+        Stream<? extends StmtContext<?, ?, ?>> effectiveSubstatements);
 }