Yang-maven-plugin refactored + fixed bugs.
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-api / src / main / java / org / opendaylight / controller / yang / model / parser / api / YangModelParser.java
index 8faf73e3b476845325cc7642ce48dadf230c3009..842bb43d79bd00573cd69a4ab298a4805a4bda5e 100644 (file)
@@ -7,40 +7,50 @@
  */
 package org.opendaylight.controller.yang.model.parser.api;
 
+import java.io.File;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
-import org.opendaylight.controller.model.api.type.UnknownTypeDefinition;
 import org.opendaylight.controller.yang.model.api.Module;
 import org.opendaylight.controller.yang.model.api.SchemaContext;
+import org.opendaylight.controller.yang.model.api.type.UnknownTypeDefinition;
 
 /**
- * Yang Model Parser interface is designed for parsing yang models and 
- * convert the information to Data Schema Tree.
- * 
+ * Yang Model Parser interface is designed for parsing yang models and convert
+ * the information to Data Schema Tree.
+ *
  */
 public interface YangModelParser {
 
-    /**
-     * Parse single Yang model file and return the schema definition of Yang
-     * module defined in *.Yang file.
-     * 
-     * @param yangFile
-     *            yang file to parse
-     * @return the schema definition of Yang module defined in .Yang file.
-     */
-    public Module parseYangModel(final String yangFile);
-
     /**
      * Parse one or more Yang model files and return the definitions of Yang
-     * modules defined in *.Yang files;
-     * <br>
+     * modules defined in *.Yang files; <br>
      * This method SHOULD be used if user need to parse multiple yang models
      * that are referenced either through import or include statements.
-     * 
-     * @param yangFiles yang files to parse
+     *
+     * @param yangFiles
+     *            yang files to parse
      * @return Set of Yang Modules
      */
-    public Set<Module> parseYangModels(final String... yangFiles);
+    Set<Module> parseYangModels(final List<File> yangFiles);
+
+    /**
+     * Equivalent to {@link #parseYangModels(List)} that returns parsed modules
+     * mapped to Files from which they were parsed.
+     *
+     * @param yangFiles
+     *            yang files to parse
+     * @return Map of Yang Modules
+     */
+    Map<File, Module> parseYangModelsMapped(final List<File> yangFiles);
+
+    Set<Module> parseYangModelsFromStreams(
+            final List<InputStream> yangModelStreams);
+
+    Map<InputStream, Module> parseYangModelsFromStreamsMapped(
+            final List<InputStream> yangModelStreams);
 
     /**
      * Creates {@link SchemaContext} from specified Modules. The modules SHOULD
@@ -49,10 +59,10 @@ public interface YangModelParser {
      * should not contain ANY Schema Nodes that contains
      * {@link UnknownTypeDefinition} and all dependencies although via import or
      * include definitions are resolved.
-     * 
+     *
      * @param modules
      *            Set of Yang Modules
      * @return Schema Context instance constructed from whole Set of Modules.
      */
-    public SchemaContext resolveSchemaContext(final Set<Module> modules);
+    SchemaContext resolveSchemaContext(final Set<Module> modules);
 }