summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/data/util/AbstractBeanContainer.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/data/util/AbstractBeanContainer.java')
-rw-r--r--server/src/com/vaadin/data/util/AbstractBeanContainer.java67
1 files changed, 8 insertions, 59 deletions
diff --git a/server/src/com/vaadin/data/util/AbstractBeanContainer.java b/server/src/com/vaadin/data/util/AbstractBeanContainer.java
index 67239996a2..d94588bdc9 100644
--- a/server/src/com/vaadin/data/util/AbstractBeanContainer.java
+++ b/server/src/com/vaadin/data/util/AbstractBeanContainer.java
@@ -848,8 +848,9 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* Adds a nested container property for the container, e.g.
* "manager.address.street".
*
- * All intermediate getters must exist and must return non-null values when
- * the property value is accessed.
+ * All intermediate getters must exist and should return non-null values
+ * when the property value is accessed. If an intermediate getter returns
+ * null, a null value will be returned.
*
* @see NestedMethodProperty
*
@@ -857,32 +858,8 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* @return true if the property was added
*/
public boolean addNestedContainerProperty(String propertyId) {
- return addNestedContainerProperty(propertyId, false);
- }
-
- /**
- * Adds a nested container property for the container, e.g.
- * "manager.address.street".
- *
- * All intermediate getters must exist and must return non-null values when
- * the property value is accessed or the <code>nullBeansAllowed</code> must
- * be set to true. If the <code>nullBeansAllowed</code> flag is set to true,
- * calling getValue of the added property will return null if the property
- * or any of its intermediate getters returns null. If set to false, null
- * values returned by intermediate getters will cause NullPointerException.
- * The default value is false to ensure backwards compatibility.
- *
- * @see NestedMethodProperty
- *
- * @param propertyId
- * @param nullBeansAllowed
- * set true to allow null values from intermediate getters
- * @return true if the property was added
- */
- public boolean addNestedContainerProperty(String propertyId,
- boolean nullBeansAllowed) {
return addContainerProperty(propertyId, new NestedPropertyDescriptor(
- propertyId, type, nullBeansAllowed));
+ propertyId, type));
}
/**
@@ -890,8 +867,9 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* property to the container. The named property itself is removed from the
* model as its subproperties are added.
*
- * All intermediate getters must exist and must return non-null values when
- * the property value is accessed.
+ * All intermediate getters must exist and should return non-null values
+ * when the property value is accessed. If an intermediate getter returns
+ * null, a null value will be returned.
*
* @see NestedMethodProperty
* @see #addNestedContainerProperty(String)
@@ -900,42 +878,13 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
*/
@SuppressWarnings("unchecked")
public void addNestedContainerBean(String propertyId) {
- addNestedContainerBean(propertyId, false);
- }
-
- /**
- * Adds a nested container properties for all sub-properties of a named
- * property to the container. The named property itself is removed from the
- * model as its subproperties are added.
- *
- * Unless
- * <code>nullBeansAllowed<code> is set to true, all intermediate getters must
- * exist and must return non-null values when the property values are
- * accessed. If the <code>nullBeansAllowed</code> flag is set to true,
- * calling getValue of the added subproperties will return null if the
- * property or any of their intermediate getters returns null. If set to
- * false, null values returned by intermediate getters will cause
- * NullPointerException. The default value is false to ensure backwards
- * compatibility.
- *
- * @see NestedMethodProperty
- * @see #addNestedContainerProperty(String)
- *
- * @param propertyId
- * @param nullBeansAllowed
- * set true to allow null values from intermediate getters
- */
- @SuppressWarnings("unchecked")
- public void addNestedContainerBean(String propertyId,
- boolean nullBeansAllowed) {
Class<?> propertyType = getType(propertyId);
LinkedHashMap<String, VaadinPropertyDescriptor<Object>> pds = BeanItem
.getPropertyDescriptors((Class<Object>) propertyType);
for (String subPropertyId : pds.keySet()) {
String qualifiedPropertyId = propertyId + "." + subPropertyId;
NestedPropertyDescriptor<BEANTYPE> pd = new NestedPropertyDescriptor<BEANTYPE>(
- qualifiedPropertyId, (Class<BEANTYPE>) type,
- nullBeansAllowed);
+ qualifiedPropertyId, (Class<BEANTYPE>) type);
model.put(qualifiedPropertyId, pd);
model.remove(propertyId);
for (BeanItem<BEANTYPE> item : itemIdToItem.values()) {