public static Mapper beanMapper ( final String property ) { return new Mapper ( ) { public Object map ( Object a ) { try { return BeanUtils . getProperty ( a , property ) ; } catch ( Exception e ) { throw new ClassCastException ( "Object was not the expected class: " + a . getClass ( ) ) ; } } } ; }
Create a mapper for bean properties