/**
  * Parses the specified request source for a parameter which corresponds to the specified param key.
  * The param filter type will be utilize to determine which pre-configured regex pattern will be utilized
  * to filter the parameter.
  * @param array $requestSource The source which the parameter data will be drawn from.
  * @param String $paramKey The key which will be used to retrieve the parameter data.
  * @param int $paramFilterType The predefined filter type which will be utilized to determine which
  * regex filter will be applied to filter the parameter value. If not specified, no filtering will occur.
  * @return The retrieved and filtered parameter value, if found. Otherwise NULL.
  */
 public static function parseRequestParam(array $requestSource, $paramKey, $paramFilterType = NULL)
 {
     if ($paramFilterType == NULL) {
         if (isset($requestSource[$paramKey])) {
             return $requestSource[$paramKey];
         } else {
             return NULL;
         }
     }
     if ($paramFilterType == RequestParser::PARAM_FILTER_TYPE_INT) {
         return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey, '/^[0-9]*$/');
     } else {
         if ($paramFilterType == RequestParser::PARAM_FILTER_TYPE_ALPHA_NUMERIC) {
             return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey, '/^[a-zA-Z0-9]*$/');
         } else {
             if ($paramFilterType == RequestParser::PARAM_FILTER_TYPE_ALPHA_ONLY) {
                 return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey, '/^[a-zA-Z]*$/');
             } else {
                 if ($paramFilterType == RequestParser::PARAM_FILTER_TYPE_ALPHA_WS_ONLY) {
                     return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey, '/^[a-zA-Z\\s]*$/');
                 } else {
                     if ($paramFilterType == RequestParser::PARAM_FILTER_TYPE_ALPHA_NUMERIC_WS_ONLY) {
                         return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey, '/^[a-zA-Z0-9\\s]*$/');
                     } else {
                         if ($paramFilterType == RequestParser::PARAM_FILTER_TYPE_EMAIL_ADDRESS) {
                             return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey, '/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/');
                         } else {
                             return RequestParser::parseRequestParamWithRegex($requestSource, $paramKey);
                         }
                     }
                 }
             }
         }
     }
 }