protected boolean isGetterMethod ( ExecutableElement executableElement ) { // must have a return value TypeMirror returnTypeMirror = executableElement . getReturnType ( ) ; if ( returnTypeMirror . getKind ( ) . equals ( TypeKind . VOID ) ) { error ( executableElement , "method %s must have a non void return type" , executableElement . getSimpleName ( ) . toString ( ) ) ; return false ; } // check if method takes no parameters List parameters = executableElement . getParameters ( ) ; if ( parameters != null && parameters . size ( ) > 0 ) { error ( executableElement , "method %s must have no parameters " , executableElement . getSimpleName ( ) . toString ( ) ) ; return false ; } return true ; }
Checks if passed element has a non void return type and takes no parameters