use of org.motechproject.mds.annotations.UIFilterable in project motech by motech.
the class UIFilterableProcessor method process.
@Override
protected void process(AnnotatedElement element) {
Class<?> classType = MemberUtil.getCorrectType(element);
if (null != classType) {
UIFilterable annotation = ReflectionsUtil.getAnnotationSelfOrAccessor(element, UIFilterable.class);
if (null != annotation) {
if (isCorrectType(classType)) {
Field fieldAnnotation = ReflectionsUtil.getAnnotationClassLoaderSafe(element, classType, Field.class);
String fieldName = MemberUtil.getFieldName(element);
String field = ReflectionsUtil.getAnnotationValue(fieldAnnotation, NAME, fieldName);
add(field);
} else {
LOGGER.warn("@UIFilterable found on field of type {}, filters on this type are not supported", classType.getName());
}
}
} else {
LOGGER.warn("Field type is unknown in: {}", element);
}
}
Aggregations