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;

    }
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.

@param userObj
An Object into which data is to be packed into
@param key
A string that represents a key to search for in the excel sheet
@param isExternalCall
A boolean that helps distinguish internally if the call is being made internally or by the user. For
external calls the index of the row would need to be bumped up,because the first row is to be ignored
always.
@return An Object which can be cast into the user's actual data type.