@Test public void shouldProcessGetter() throws Exception { Method getServerDate = getAccessibleMethod(Sample.class, "getServerDate", new Class[0]); processor.process(getServerDate); Collection<String> fields = processor.getElements(); assertEquals(1, fields.size()); String fieldName = fields.iterator().next(); assertEquals("serverDate", fieldName); }
@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); } }
UIFilterableProcessor extends AbstractListProcessor<UIFilterable, String> { @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); } } }
UIFilterableProcessor extends AbstractListProcessor<UIFilterable, String> { @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); } }  }
UIFilterableProcessor extends AbstractListProcessor<UIFilterable, String> { @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); } }  @Override Class<UIFilterable> getAnnotationType(); @Override Collection<String> getProcessingResult(); void setClazz(Class clazz); }
UIFilterableProcessor extends AbstractListProcessor<UIFilterable, String> { @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); } }  @Override Class<UIFilterable> getAnnotationType(); @Override Collection<String> getProcessingResult(); void setClazz(Class clazz);  }