public static @Nullable PsiClassType getDeclaredEventType(@NotNull XmlAttribute xmlAttribute) {
    final PsiClass tagClass = getTagClass(xmlAttribute.getParent());
    if (tagClass != null) {
      final PsiType eventHandlerPropertyType = getEventHandlerPropertyType(tagClass, xmlAttribute.getName());
      if (eventHandlerPropertyType != null) {
        final PsiClass controllerClass = getControllerClass(xmlAttribute.getContainingFile());
        if (controllerClass != null) {
          final PsiSubstitutor tagClassSubstitutor = getTagClassSubstitutor(xmlAttribute, controllerClass);

          final PsiType handlerType = tagClassSubstitutor != null ?
                                      tagClassSubstitutor.substitute(eventHandlerPropertyType) : eventHandlerPropertyType;
          final PsiClassType eventType = substituteEventType(handlerType, xmlAttribute.getProject());
          final PsiType erasedType = eraseFreeTypeParameters(eventType, tagClass);
          return erasedType instanceof PsiClassType ? (PsiClassType)erasedType : null;
        }
      }
    }
    return null;
  }
public static @Nullable PsiClassType getDeclaredEventType(@NotNull XmlAttribute xmlAttribute)