Speed up AbstractBuilderTemplate.removeProperty()
[mdsal.git] / binding / mdsal-binding-java-api-generator / src / main / java / org / opendaylight / mdsal / binding / java / api / generator / InterfaceTemplate.xtend
index 8f71efaefe8e26436e39010c2f102a77d7a0e616..deb9b6b0a236f1918fb7d19f7d680729e2d15ca5 100644 (file)
@@ -50,14 +50,10 @@ class InterfaceTemplate extends BaseTemplate {
      * Creates the instance of this class which is used for generating the interface file source
      * code from <code>genType</code>.
      *
-     * @throws IllegalArgumentException if <code>genType</code> equals <code>null</code>
+     * @throws NullPointerException if <code>genType</code> is <code>null</code>
      */
     new(GeneratedType genType) {
         super(genType)
-        if (genType === null) {
-            throw new IllegalArgumentException("Generated type reference cannot be NULL!")
-        }
-
         consts = genType.constantDefinitions
         methods = genType.methodDefinitions
         enums = genType.enumerations
@@ -88,18 +84,10 @@ class InterfaceTemplate extends BaseTemplate {
 
     '''
 
-
     def private generateAnnotations(List<AnnotationType> annotations) '''
         «IF annotations !== null && !annotations.empty»
             «FOR annotation : annotations»
-                @«annotation.importedName»
-                «IF annotation.parameters !== null && !annotation.parameters.empty»
-                (
-                «FOR param : annotation.parameters SEPARATOR ","»
-                    «param.name»=«param.value»
-                «ENDFOR»
-                )
-                «ENDIF»
+                «annotation.generateAnnotation»
             «ENDFOR»
         «ENDIF»
     '''