List<Field> fields = new ReflectionFieldProvider().getProperties(source.get());
for (FieldFilter filter : filters) {
fields = filter.filter(fields);
}
for (Field field : fields) {
ElementController controller;
try {
Element<T, ?, ?> element = null;
if (Property.class.isAssignableFrom(field.getType())) {
element = new PropertyElement(field);
} else if (ReadOnlyProperty.class.isAssignableFrom(field.getType())) {
element = new ReadOnlyPropertyElement(field);
}
if (element != null) {
element.sourceProperty().bind(source);
controller = new ElementController(element);
controllers.add(controller);
}
} catch (FormException e) {
e.printStackTrace();
}