protected Object getSingleExcelRow ( Object userObj , String key , boolean isExternalCall ) { logger . entering ( new Object [ ] { userObj , key , isExternalCall } ) ; Class < ? > cls ; try { cls = Class . forName ( userObj . getClass ( ) . getName ( ) ) ; } catch ( ClassNotFoundException e ) { throw new DataProviderException ( "Unable to find class of type + '" + userObj . getClass ( ) . getName ( ) + "'" , e ) ; } int rowIndex = excelReader . getRowIndex ( cls . getSimpleName ( ) , key ) ; if ( rowIndex == - 1 ) { throw new DataProviderException ( "Row with key '" + key + "' is not found" ) ; } Object object = getSingleExcelRow ( userObj , rowIndex , isExternalCall ) ; logger . exiting ( object ) ; return object ; }
This method fetches a specific row from an excel sheet which can be identified using a key and returns the data as an Object which can be cast back into the user s actual data type .