// parameters.
@SuppressWarnings({ "rawtypes", "unchecked" })
private static ExecutableElement getWidgetMethodName( final TypeElement classElement,
final ProcessingEnvironment processingEnvironment,
final Class annotation ) throws GenerationException {
final Types typeUtils = processingEnvironment.getTypeUtils();
final Elements elementUtils = processingEnvironment.getElementUtils();
final TypeMirror requiredReturnType = elementUtils.getTypeElement( "com.google.gwt.user.client.ui.IsWidget" ).asType();
final List<ExecutableElement> methods = ElementFilter.methodsIn( classElement.getEnclosedElements() );
ExecutableElement match = null;
for ( ExecutableElement e : methods ) {
final TypeMirror actualReturnType = e.getReturnType();
//Check method
if ( e.getAnnotation( annotation ) == null ) {
continue;
}
if ( !typeUtils.isAssignable( actualReturnType,
requiredReturnType ) ) {
continue;
}
if ( e.getParameters().size() != 0 ) {
continue;