public static String [ ] [ ] getProperties ( final Bean bean ) { final List < String > propertyNames = bean . getPropertyNames ( ) ; final int psize = propertyNames . size ( ) ; final String [ ] [ ] properties = new String [ psize ] [ ] ; for ( int i = 0 ; i < psize ; i ++ ) { final String propertyName = propertyNames . get ( i ) ; final List < String > values = bean . getValues ( propertyName ) ; final int vsize = values . size ( ) ; properties [ i ] = new String [ vsize + 1 ] ; properties [ i ] [ 0 ] = propertyName ; for ( int j = 0 ; j < vsize ; j ++ ) { properties [ i ] [ j + 1 ] = values . get ( j ) ; } } return properties ; }
In order to reduce the amount of property data stored we convert the properties into a String matrix . The first element is the property name followed by its values .