protected void extractBeanDescriptor ( ) { Object defaultInstance = null ; try { defaultInstance = getBeanClass ( ) . newInstance ( ) ; } catch ( Exception e ) { LOGGER . debug ( "Failed to create a new default instance for class " + this . beanClass + ". The BeanDescriptor will not contains any default value information." , e ) ; } try { // Get public fields for ( Class < ? > currentClass = this . beanClass ; currentClass != null ; currentClass = currentClass . getSuperclass ( ) ) { Field [ ] fields = currentClass . getFields ( ) ; for ( Field field : fields ) { if ( ! Modifier . isStatic ( field . getModifiers ( ) ) ) { extractPropertyDescriptor ( field , defaultInstance ) ; } } } // Get getter/setter based properties BeanInfo beanInfo = Introspector . getBeanInfo ( this . beanClass ) ; java . beans . PropertyDescriptor [ ] propertyDescriptors = beanInfo . getPropertyDescriptors ( ) ; if ( propertyDescriptors != null ) { for ( java . beans . PropertyDescriptor propertyDescriptor : propertyDescriptors ) { if ( propertyDescriptor != null ) { extractPropertyDescriptor ( propertyDescriptor , defaultInstance ) ; } } } } catch ( Exception e ) { LOGGER . error ( "Failed to load bean descriptor for class " + this . beanClass , e ) ; } }
Extract informations form the bean .