Is there any way in Vaadin7 to tell BeanContainer to use public fields of the underlying bean directly, without accessor methods? Sometime they just clutter the code and adding them just for BeanContainer smells
Unfortunately there’s no way unless you write your own. BeanContainer uses java.beans.PropertyDescriptor to find the properties. And by JavaBeans conventions you have to have get/set methods. Although with BeanContainer the items don’t have to be actual Beans, but instead regular pojos, still the get/set methods are required.
You could write a subclass of BeanContainer where you remove the PropertyDescriptors added automatically and add your own (customized) PropertyDescriptors - there is a protected API for adding new PropertyDescriptors. It should not be very hard. I strongly recommend setting up the property descriptors before adding beans to avoid creating and discarding and re-creating properties for the beans.