nested-properties

WPF ListView - Sorting by Nested Properties

I have recently stumbled across an issue where the WPF ListView control seems to be restricting the ability to sort its items. Specifically, I am having a great deal of trouble trying to get a SortDescription to recognise nested properties (properties of properties). For straight-forward sorting by propreties, the following line should ...

How to prevent NPE when accessing a nested/indexed property of a bean

Is there any way to prevent NPE when accessing a nested bean using commons-beanutils? Here is my code: new BeanUtilsBean().getProperty(human, "parent.name"); In this case I want getProperty() to either return empty string ("") when human.getParent() == null or handle it in a way other that throwing an NPE. ...