[ http://issues.apache.org/jira/browse/BEANUTILS-261?page=comments#action_12449270 ] Niall Pemberton commented on BEANUTILS-261: -------------------------------------------
If we're doing the getNestedProperty() method then should we also create equivalent methods for setNestedProperty() and getPropertyDescriptor() as well - then there are also the BeanUtils getNestedtProperty(), setProperty(), getProperty() methods? My preference is not to do it, since IMO it doesn't add anything of real value to BeanUtils and just bloats the API - anyone can easily create their own static method that wraps the PropertyUtils and catches NestedNullException to return null. > Return null but not throw NestedNullException if the nested property is null > ---------------------------------------------------------------------------- > > Key: BEANUTILS-261 > URL: http://issues.apache.org/jira/browse/BEANUTILS-261 > Project: Commons BeanUtils > Issue Type: New Feature > Components: Bean / Property Utils > Reporter: Jiemiao Shi > > Can provide a method in PropertyUtils to get nested properties without > throwing a NestedNullException when any of the no-end property is null? > example: > /* code begin */ > Employee employee=... > emplyee.setAddress(null); > String street=(String) PropertyUtils.getNestedProperty(employee, > "address.street");// #### > /* code end */ > The statement #### will throws a NestedNullException, but return null will > make it easier to write code in some situation. So can please provide a > method only return null? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
