Messages messages = resources.getMessages();
ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);
final BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer, messages);
List<String> propertyNames = newList();
Map<String, Runnable> worksheet = newMap();
for (final String propertyName : adapter.getPropertyNames())
{
PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);
if (!pa.isRead()) continue;
if (pa.getAnnotation(NonVisual.class) != null) continue;
if (filterReadOnlyProperties && !pa.isUpdate()) continue;
final String dataType = _dataTypeAnalyzer.identifyDataType(pa);
// If an unregistered type, then ignore the property.
if (dataType == null) continue;
propertyNames.add(propertyName);
// We need to defer execution of this; we want to add them in proper order, not
// alphabetical order.
Runnable worker = new Runnable()
{
public void run()
{
model.add(propertyName).dataType(dataType);
}
};
worksheet.put(propertyName, worker);
}