@Test public void shouldReturnCorrectElementList() throws Exception { List<AnnotatedElement> actual = new ArrayList<>(); actual.addAll(processor.getElementsToProcess()); assertEquals(Sample.FIELD_COUNT, actual.size()); assertHasField(actual, "world"); assertHasField(actual, "pi"); assertHasField(actual, "serverDate"); assertHasField(actual, "localTime"); }
@Override protected Set<? extends AnnotatedElement> getElementsToProcess() { List<Member> members = ReflectionsUtil.getFilteredMembers(clazz, entityField()); Set<AnnotatedElement> elements = new LinkedHashSet<>(members.size()); for (Member member : members) { if (member instanceof AnnotatedElement) { elements.add((AnnotatedElement) member); } } return elements; }
FieldProcessor extends AbstractListProcessor<Field, FieldDto> { @Override protected Set<? extends AnnotatedElement> getElementsToProcess() { List<Member> members = ReflectionsUtil.getFilteredMembers(clazz, entityField()); Set<AnnotatedElement> elements = new LinkedHashSet<>(members.size()); for (Member member : members) { if (member instanceof AnnotatedElement) { elements.add((AnnotatedElement) member); } } return elements; } }
FieldProcessor extends AbstractListProcessor<Field, FieldDto> { @Override protected Set<? extends AnnotatedElement> getElementsToProcess() { List<Member> members = ReflectionsUtil.getFilteredMembers(clazz, entityField()); Set<AnnotatedElement> elements = new LinkedHashSet<>(members.size()); for (Member member : members) { if (member instanceof AnnotatedElement) { elements.add((AnnotatedElement) member); } } return elements; }  }
FieldProcessor extends AbstractListProcessor<Field, FieldDto> { @Override protected Set<? extends AnnotatedElement> getElementsToProcess() { List<Member> members = ReflectionsUtil.getFilteredMembers(clazz, entityField()); Set<AnnotatedElement> elements = new LinkedHashSet<>(members.size()); for (Member member : members) { if (member instanceof AnnotatedElement) { elements.add((AnnotatedElement) member); } } return elements; }  @Override Class<Field> getAnnotationType(); @Override Collection<FieldDto> getProcessingResult(); void setEntity(EntityDto entity); void setClazz(Class clazz); }
FieldProcessor extends AbstractListProcessor<Field, FieldDto> { @Override protected Set<? extends AnnotatedElement> getElementsToProcess() { List<Member> members = ReflectionsUtil.getFilteredMembers(clazz, entityField()); Set<AnnotatedElement> elements = new LinkedHashSet<>(members.size()); for (Member member : members) { if (member instanceof AnnotatedElement) { elements.add((AnnotatedElement) member); } } return elements; }  @Override Class<Field> getAnnotationType(); @Override Collection<FieldDto> getProcessingResult(); void setEntity(EntityDto entity); void setClazz(Class clazz);  }