Bug 3670 (part 1/5): Use of new statement parser in yang-maven-plugin
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / reactor / CrossSourceStatementReactor.java
index c8040809941da736e6b7928e629f8dd2a83cf421..fc3b31222e1260c3e77e2d00d47cd1bac6a85782 100644 (file)
@@ -7,8 +7,12 @@
  */
 package org.opendaylight.yangtools.yang.parser.stmt.reactor;
 
-import java.util.Collection;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
 
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Collection;
 import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.EffectiveSchemaContext;
 import com.google.common.collect.ImmutableMap;
@@ -94,6 +98,15 @@ public class CrossSourceStatementReactor {
             return context.buildEffective();
         }
 
+        public SchemaContext buildEffective(List<InputStream> yangInputStreams) throws SourceException, ReactorException {
+
+            for(InputStream yangInputStream : yangInputStreams) {
+                addSource(new YangStatementSourceImpl(yangInputStream));
+            }
+
+            return buildEffective();
+        }
+
     }