use of org.robobinding.internal.java_beans.PropertyDescriptor in project RoboBinding by RoboBinding.
the class BeanCursor method mapColumnToPropertyDescriptor.
private PropertyDescriptor mapColumnToPropertyDescriptor(int column) {
String propertyName = mapColumnToPropertyName(column);
PropertyDescriptor descriptor = propertyDescriptorMap.get(propertyName);
return descriptor;
}
use of org.robobinding.internal.java_beans.PropertyDescriptor in project RoboBinding by RoboBinding.
the class BeanCursor method getColumnValue.
private Object getColumnValue(int column) {
Preconditions.checkArgument(column < getNumColumns(), "column '" + column + "' is out of bound");
PropertyDescriptor descriptor = mapColumnToPropertyDescriptor(column);
try {
return descriptor.getReadMethod().invoke(getBean(), new Object[0]);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
} catch (IllegalArgumentException e) {
throw new RuntimeException(e);
} catch (InvocationTargetException e) {
throw new RuntimeException(e);
}
}
use of org.robobinding.internal.java_beans.PropertyDescriptor in project RoboBinding by RoboBinding.
the class PropertyUtils method getPropertyDescriptors.
public static Set<PropertyDescriptor> getPropertyDescriptors(Class<?> beanClass) {
PropertyDescriptor[] propertyDescriptorArray = getPropertyDescriptors0(beanClass);
Set<PropertyDescriptor> propertyDescriptors = Sets.newHashSet();
for (PropertyDescriptor propertyDescriptor : propertyDescriptorArray) {
if (EXCLUDED_PROPERTY_NAMES.contains(propertyDescriptor.getName())) {
continue;
}
propertyDescriptors.add(propertyDescriptor);
}
return propertyDescriptors;
}
use of org.robobinding.internal.java_beans.PropertyDescriptor in project RoboBinding by RoboBinding.
the class PropertyUtils method getPropertyNames.
public static Set<String> getPropertyNames(Class<?> beanClass) {
PropertyDescriptor[] propertyDescriptorArray = getPropertyDescriptors0(beanClass);
Set<String> propertyNames = Sets.newHashSet();
for (PropertyDescriptor propertyDescriptor : propertyDescriptorArray) {
if (EXCLUDED_PROPERTY_NAMES.contains(propertyDescriptor.getName())) {
continue;
}
propertyNames.add(propertyDescriptor.getName());
}
return propertyNames;
}
Aggregations