+ def private accessorJavadoc(MethodSignature method, String orString) {
+ accessorJavadoc(method, orString, null)
+ }
+
+ def private accessorJavadoc(MethodSignature method, String orString, JavaTypeName exception) {
+ val propName = method.propertyNameFromGetter
+ val propReturn = propName + orString
+
+ return wrapToDocumentation('''
+ Return «propReturn»
+
+ «method.comment?.referenceDescription.formatReference»
+ @return {@code «method.returnType.importedName»} «propReturn»
+ «IF exception !== null»
+ @throws «exception.importedName» if «propName» is not present
+ «ENDIF»
+ ''')
+ }
+
+ def private generateAccessorMethod(MethodSignature method) {
+ return '''
+ «accessorJavadoc(method, ", or {@code null} if it is not present.")»
+ «method.generateAccessorAnnotations»
+ «method.returnType.nullableType» «method.name»();
+ '''
+ }
+