Remove unnecessary casts
[mdsal.git] / code-generator / binding-java-api-generator / src / main / java / org / opendaylight / yangtools / sal / java / api / generator / InterfaceTemplate.xtend
index 329680808073322ee87d9b9ebd29b713bddec487..606fd753718b096bee210193b44231bd9ef3318c 100644 (file)
@@ -58,15 +58,13 @@ class InterfaceTemplate extends BaseTemplate {
         enclosedGeneratedTypes = genType.enclosedTypes
     }
     
-
-    
     /**
      * Template method which generate the whole body of the interface.
      * 
      * @return string with code for interface body in JAVA format
      */
     override body() '''
-        «type.comment.asJavadoc»
+        «wrapToDocumentation(formatDataForJavaDoc(type))»
         public interface «type.name»
             «superInterfaces»
         {
@@ -87,7 +85,7 @@ class InterfaceTemplate extends BaseTemplate {
     def private generateAnnotations(List<AnnotationType> annotations) '''
         «IF annotations != null && !annotations.empty»
             «FOR annotation : annotations»
-                @«annotation.name»
+                @«annotation.importedName»
                 «IF annotation.parameters != null && !annotation.parameters.empty»
                 (
                 «FOR param : annotation.parameters SEPARATOR ","»
@@ -123,12 +121,12 @@ class InterfaceTemplate extends BaseTemplate {
         «IF !enclosedGeneratedTypes.empty»
             «FOR innerClass : enclosedGeneratedTypes SEPARATOR "\n"»
                 «IF (innerClass instanceof GeneratedTransferObject)»
-                    «IF (innerClass as GeneratedTransferObject).unionType»
-                        «val unionTemplate = new UnionTemplate(innerClass as GeneratedTransferObject
+                    «IF innerClass.unionType»
+                        «val unionTemplate = new UnionTemplate(innerClass)»
                         «unionTemplate.generateAsInnerClass»
                         «this.importMap.putAll(unionTemplate.importMap)»
                     «ELSE»
-                        «val classTemplate = new ClassTemplate(innerClass as GeneratedTransferObject
+                        «val classTemplate = new ClassTemplate(innerClass)»
                         «classTemplate.generateAsInnerClass»
                         «this.importMap.putAll(classTemplate.importMap)»
                     «ENDIF»