Class ReflectiveColumnPropertyAccessor<R>
java.lang.Object
org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor<R>
- Type Parameters:
R- type of the row object/bean
- All Implemented Interfaces:
IColumnAccessor<R>,IColumnPropertyAccessor<R>,IColumnPropertyResolver
- Direct Known Subclasses:
ExtendedReflectiveColumnPropertyAccessor,HierarchicalReflectiveColumnPropertyAccessor
public class ReflectiveColumnPropertyAccessor<R>
extends Object
implements IColumnPropertyAccessor<R>
Convenience class which uses java reflection to get/set property names from
the row bean. It looks for getter methods for reading and setter methods for
writing according to the Java conventions.
-
Constructor Summary
ConstructorsConstructorDescriptionReflectiveColumnPropertyAccessor(String... propertyNames) ReflectiveColumnPropertyAccessor(List<String> propertyNames) -
Method Summary
Modifier and TypeMethodDescriptionintintgetColumnIndex(String propertyName) getColumnProperty(int columnIndex) getDataValue(R rowObj, int columnIndex) protected PropertyDescriptorgetPropertyDescriptor(Object rowObj, String propertyName) voidsetDataValue(R rowObj, int columnIndex, Object newValue)
-
Constructor Details
-
ReflectiveColumnPropertyAccessor
- Parameters:
propertyNames- of the members of the row bean
-
ReflectiveColumnPropertyAccessor
- Parameters:
propertyNames- of the members of the row bean- Since:
- 1.4
-
-
Method Details
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceIColumnAccessor<R>
-
getDataValue
- Specified by:
getDataValuein interfaceIColumnAccessor<R>
-
setDataValue
- Specified by:
setDataValuein interfaceIColumnAccessor<R>
-
getColumnProperty
- Specified by:
getColumnPropertyin interfaceIColumnPropertyResolver- Parameters:
columnIndex- i.e the order of the column in the backing bean- Returns:
- the column property name for the provided column index.
-
getColumnIndex
- Specified by:
getColumnIndexin interfaceIColumnPropertyResolver- Parameters:
propertyName- i.e the name of the column in the backing bean- Returns:
- the column index for the provided property name.
-
getPropertyDescriptor
protected PropertyDescriptor getPropertyDescriptor(Object rowObj, String propertyName) throws IntrospectionException - Parameters:
rowObj- The Java Bean for which thePropertyDescriptoris requested.propertyName- The name of the property for which thePropertyDescriptoris requested.- Returns:
- The
PropertyDescriptorthat describes the property with the given name in the given Java Bean object that exports it via a pair of accessor methods. - Throws:
IntrospectionException- if an exception occurs during introspection- Since:
- 1.6
-