void exportToBeanProperty ( Object target , String property , Object result ) throws JspTagException { PropertyDescriptor [ ] descriptors ; try { descriptors = Introspector . getBeanInfo ( target . getClass ( ) ) . getPropertyDescriptors ( ) ; } catch ( IntrospectionException ex ) { throw new JspTagException ( ex ) ; } for ( PropertyDescriptor pd : descriptors ) { if ( pd . getName ( ) . equals ( property ) ) { Method m = pd . getWriteMethod ( ) ; if ( m == null ) { throw new JspTagException ( Resources . getMessage ( "SET_NO_SETTER_METHOD" , property ) ) ; } try { m . invoke ( target , convertToExpectedType ( result , m ) ) ; } catch ( ELException ex ) { throw new JspTagException ( ex ) ; } catch ( IllegalAccessException ex ) { throw new JspTagException ( ex ) ; } catch ( InvocationTargetException ex ) { throw new JspTagException ( ex ) ; } return ; } } throw new JspTagException ( Resources . getMessage ( "SET_INVALID_PROPERTY" , property ) ) ; }
Export the result into a bean property .