Class BeanItem<BT>
- All Implemented Interfaces:
Item,Item.PropertySetChangeNotifier,Serializable,Cloneable
- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Item
Item.Editor, Item.PropertySetChangeListener, Item.PropertySetChangeNotifier, Item.Viewer -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofBeanItemand adds all properties of a Java Bean to it.Creates a new instance ofBeanItemand adds all properties of a Java Bean to it.Creates a new instance ofBeanItemand adds all listed properties of a Java Bean to it - in specified order.BeanItem(BT bean, Collection<?> propertyIds) Creates a new instance ofBeanItemand adds all listed properties of a Java Bean to it - in specified order. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNestedProperty(String nestedPropertyId) Adds a nested property to the item.voidexpandProperty(String propertyId, String... subPropertyIds) Expands nested bean properties by replacing a top-level property with some or all of its sub-properties.getBean()Gets the underlying JavaBean object.voidChanges the Java Bean this item is based on.Methods inherited from class com.vaadin.featurepack.data.util.PropertysetItem
addItemProperty, addListener, addPropertySetChangeListener, clone, equals, getItemProperty, getItemPropertyIds, getListeners, hashCode, removeItemProperty, removeListener, removePropertySetChangeListener, toString
-
Constructor Details
-
BeanItem
Creates a new instance of
BeanItemand adds all properties of a Java Bean to it. The properties are identified by their respective bean names.Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone
isandaremethods are not supported.- Parameters:
bean- the Java Bean to copy properties from.
-
BeanItem
Creates a new instance of
BeanItemand adds all properties of a Java Bean to it. The properties are identified by their respective bean names.Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone
isandaremethods are not supported.- Parameters:
bean- the Java Bean to copy properties from.beanClass- class of thebean- Since:
- 7.4
-
BeanItem
Creates a new instance of
BeanItemand adds all listed properties of a Java Bean to it - in specified order. The properties are identified by their respective bean names.Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone
isandaremethods are not supported.- Parameters:
bean- the Java Bean to copy properties from.propertyIds- id of the property.
-
BeanItem
Creates a new instance of
BeanItemand adds all listed properties of a Java Bean to it - in specified order. The properties are identified by their respective bean names.Note : This version only supports introspectable bean properties and their getter and setter methods. Stand-alone
isandaremethods are not supported.- Parameters:
bean- the Java Bean to copy properties from.propertyIds- ids of the properties.
-
-
Method Details
-
expandProperty
Expands nested bean properties by replacing a top-level property with some or all of its sub-properties. The expansion is not recursive.- Parameters:
propertyId- property id for the property whose sub-properties are to be expanded,subPropertyIds- sub-properties to expand, all sub-properties are expanded if not specified
-
addNestedProperty
Adds a nested property to the item. The property must not exist in the item already and must of form "field1.field2" where field2 is a field in the object referenced to by field1. If an intermediate property returns null, the property will return a null value- Parameters:
nestedPropertyId- property id to add.
-
getBean
Gets the underlying JavaBean object.- Returns:
- the bean object.
-
setBean
Changes the Java Bean this item is based on.This will cause any existing properties to be re-mapped to the new bean. Any added custom properties which are not of type
MethodPropertyorNestedMethodPropertywill not be updated to reflect the change of bean.Changing the bean will fire value change events for all properties of type
MethodPropertyorNestedMethodProperty.- Parameters:
bean- The new bean to use for this item, notnull- Since:
- 7.7.7
-