use of org.eclipse.scout.rt.client.dto.FormData in project scout.rt by eclipse.
the class AbstractForm method getFormDataClass.
protected Class<? extends AbstractFormData> getFormDataClass() {
FormData formDataAnnotation = getClass().getAnnotation(FormData.class);
// look in superclasses for annotation
Class<?> superclazz = getClass().getSuperclass();
while (formDataAnnotation == null && superclazz != null) {
formDataAnnotation = superclazz.getAnnotation(FormData.class);
superclazz = superclazz.getSuperclass();
}
if (formDataAnnotation == null) {
// no annotation found..
return null;
}
@SuppressWarnings("unchecked") Class<? extends AbstractFormData> formDataClass = formDataAnnotation.value();
if (formDataClass == null) {
return null;
}
if (AbstractFormData.class.isAssignableFrom(formDataClass) && !Modifier.isAbstract(formDataClass.getModifiers())) {
return formDataClass;
}
return null;
}
Aggregations