public static Map getPropertyDescriptors ( Class targetClass ) throws IntrospectionException , OgnlException { Map result ; if ( ( result = ( Map ) _propertyDescriptorCache . get ( targetClass ) ) == null ) { synchronized ( _propertyDescriptorCache ) { if ( ( result = ( Map ) _propertyDescriptorCache . get ( targetClass ) ) == null ) { PropertyDescriptor [ ] pda = Introspector . getBeanInfo ( targetClass ) . getPropertyDescriptors ( ) ; result = new HashMap ( 101 ) ; for ( int i = 0 , icount = pda . length ; i < icount ; i ++ ) { // workaround for Introspector bug 6528714 (bugs.sun.com) if ( pda [ i ] . getReadMethod ( ) != null && ! isMethodCallable ( pda [ i ] . getReadMethod ( ) ) ) { pda [ i ] . setReadMethod ( findClosestMatchingMethod ( targetClass , pda [ i ] . getReadMethod ( ) , pda [ i ] . getName ( ) , pda [ i ] . getPropertyType ( ) , true ) ) ; } if ( pda [ i ] . getWriteMethod ( ) != null && ! isMethodCallable ( pda [ i ] . getWriteMethod ( ) ) ) { pda [ i ] . setWriteMethod ( findClosestMatchingMethod ( targetClass , pda [ i ] . getWriteMethod ( ) , pda [ i ] . getName ( ) , pda [ i ] . getPropertyType ( ) , false ) ) ; } result . put ( pda [ i ] . getName ( ) , pda [ i ] ) ; } findObjectIndexedPropertyDescriptors ( targetClass , result ) ; _propertyDescriptorCache . put ( targetClass , result ) ; } } } return result ; }
This method returns the property descriptors for the given class as a Map .