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 TypeMethodDescriptionint
int
getColumnIndex
(String propertyName) getColumnProperty
(int columnIndex) getDataValue
(R rowObj, int columnIndex) protected PropertyDescriptor
getPropertyDescriptor
(Object rowObj, String propertyName) void
setDataValue
(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:
getColumnCount
in interfaceIColumnAccessor<R>
-
getDataValue
- Specified by:
getDataValue
in interfaceIColumnAccessor<R>
-
setDataValue
- Specified by:
setDataValue
in interfaceIColumnAccessor<R>
-
getColumnProperty
- Specified by:
getColumnProperty
in 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:
getColumnIndex
in 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 thePropertyDescriptor
is requested.propertyName
- The name of the property for which thePropertyDescriptor
is requested.- Returns:
- The
PropertyDescriptor
that 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
-