IValueProperty property;
PropertyDescriptor propertyDescriptor;
if (beanClass == null) {
propertyDescriptor = null;
property = new PojoValuePropertyDecorator(
new AnonymousPojoValueProperty(propertyNames[0], valueType),
null);
} else {
propertyDescriptor = BeanPropertyHelper.getPropertyDescriptor(
beanClass, propertyNames[0]);
property = new PojoValueProperty(propertyDescriptor, valueType);
}
IBeanValueProperty beanProperty = new PojoValuePropertyDecorator(
property, propertyDescriptor);
for (int i = 1; i < propertyNames.length; i++) {
beanProperty = beanProperty.value(propertyNames[i]);
}
return beanProperty;
}