return eventMethod.getParameters()[0].getType().isClassOrInterface();
}
private void ensureStaticGetTypeMethodExists(JClassType eventType)
throws UnableToCompleteException {
JMethod getTypeMethod = eventType.findMethod("getType", new JType[0]);
if (getTypeMethod == null
|| !getTypeMethod.isStatic()
|| getTypeMethod.getParameters().length != 0) {
logger.log(TreeLogger.ERROR, getErrorPrefix(eventType.getName())
+ ", but this event class does not have a static getType method with no parameters.");
throw new UnableToCompleteException();
}
JClassType getTypeReturnType = getTypeMethod.getReturnType().isClassOrInterface();
if (getTypeReturnType == null
|| !classCollection.gwtEventTypeClass.isAssignableFrom(getTypeReturnType)) {
logger.log(TreeLogger.ERROR, getErrorPrefix(eventType.getName())
+ ", but this event class getType() method does not return on object of type "
+ ClassCollection.gwtEventTypeClassName);