Search in sources :

Example 1 with FormData

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;
}
Also used : FormData(org.eclipse.scout.rt.client.dto.FormData) AbstractFormData(org.eclipse.scout.rt.shared.data.form.AbstractFormData) AbstractFormData(org.eclipse.scout.rt.shared.data.form.AbstractFormData)

Aggregations

FormData (org.eclipse.scout.rt.client.dto.FormData)1 AbstractFormData (org.eclipse.scout.rt.shared.data.form.AbstractFormData)1