Use properly module file path resolver
[mdsal.git] / binding2 / mdsal-binding2-java-api-generator / src / main / twirl / org / opendaylight / mdsal / binding / javav2 / java / api / generator / yangModuleInfoTemplate.scala.txt
index 4e752537bae3aafbccaec601a807416a106d1d5c..e2a7fedacac33c1ff323b257bd06cfeaaf2d6d54 100644 (file)
@@ -6,6 +6,8 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  *@
 
+@import java.util.function.Function;
+@import java.util.Optional
 @import org.opendaylight.mdsal.binding.javav2.generator.util.JavaIdentifier.CLASS
 @import org.opendaylight.mdsal.binding.javav2.generator.util.JavaIdentifierNormalizer.normalizeSpecificIdentifier
 @import org.opendaylight.mdsal.binding.javav2.generator.util.JavaIdentifierNormalizer.normalizeFullPackageName
@@ -16,7 +18,8 @@
 @import org.opendaylight.yangtools.yang.model.api.Module
 @import org.opendaylight.yangtools.yang.model.api.SchemaContext
 
-@(module: Module, ctx: SchemaContext, importedNames: Map[String, String])
+@(module: Module, ctx: SchemaContext, importedNames: Map[String, String],
+moduleFilePathResolver: Function[Module, Optional[String]])
 @if(module != null && ctx != null) {
 public final class @{MODULE_INFO_CLASS_NAME} implements @{importedNames.get("yangModuleInfo")} {
 
@@ -26,7 +29,7 @@ public final class @{MODULE_INFO_CLASS_NAME} implements @{importedNames.get("yan
     private final @{importedNames.get("string")} namespace = "@{module.getNamespace.toString}";
     private final @{importedNames.get("string")} semanticVersion = "@{module.getSemanticVersion}";
     private final @{importedNames.get("string")} revision = "@{module.getQNameModule.getFormattedRevision}";
-    private final @{importedNames.get("string")} resourcePath = "@{getSourcePath(module)}";
+    private final @{importedNames.get("string")} resourcePath = "@{getSourcePath(module, moduleFilePathResolver)}";
     private final @{importedNames.get("set")}<YangModuleInfo> importedModules;
 
     public static @{importedNames.get("yangModuleInfo")} getInstance() {
@@ -47,7 +50,7 @@ public final class @{MODULE_INFO_CLASS_NAME} implements @{importedNames.get("yan
         private final @{importedNames.get("string")} semanticVersion = "@{submodule.getSemanticVersion}";
         private final @{importedNames.get("string")} namespace = "@{submodule.getNamespace.toString}";
         private final @{importedNames.get("string")} revision = "@{submodule.getQNameModule.getFormattedRevision}";
-        private final @{importedNames.get("string")} resourcePath = "@{getSourcePath(submodule)}";
+        private final @{importedNames.get("string")} resourcePath = "@{getSourcePath(submodule, moduleFilePathResolver)}";
         private final @{importedNames.get("set")}<YangModuleInfo> importedModules;
 
         public static @{importedNames.get("yangModuleInfo")} getInstance() {