Search in sources :

Example 1 with PropertyDescriptor

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;
}
Also used : PropertyDescriptor(org.robobinding.internal.java_beans.PropertyDescriptor)

Example 2 with PropertyDescriptor

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);
    }
}
Also used : PropertyDescriptor(org.robobinding.internal.java_beans.PropertyDescriptor) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Example 3 with PropertyDescriptor

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;
}
Also used : PropertyDescriptor(org.robobinding.internal.java_beans.PropertyDescriptor)

Example 4 with PropertyDescriptor

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;
}
Also used : PropertyDescriptor(org.robobinding.internal.java_beans.PropertyDescriptor)

Aggregations

PropertyDescriptor (org.robobinding.internal.java_beans.PropertyDescriptor)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)1