src/org/ohmage/validator/UserValidators.java
public static String validateEmailAddress(final String value) 
			throws ValidationException {
		
		LOGGER.info("Validating that an email address is valid.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		if(StringUtils.isValidEmailAddress(value.trim())) {
			return value.trim();
		}
		else {
			throw new ValidationException(
					ErrorCode.USER_INVALID_EMAIL_ADDRESS, 
					"The email address value for the user is invalid: " + 
						value);
		}
	}
/**
	 * Validates that the email address for a user is a valid email address.
	 * 
	 * @param value The String value of the user's email address.
	 * 
	 * @return Returns null if the value is null or whitespace only; otherwise,
	 * 		   it returns the email address.
	 * 
	 * @throws ValidationException Thrown if the email address is not a valid
	 * 							   email address.
	 */
Validates that the email address for a user is a valid email address.

@param value The String value of the user's email address.

@return Returns null if the value is null or whitespace only; otherwise,
it returns the email address.

@throws ValidationException Thrown if the email address is not a valid
email address.
Validates that the email address for a user is a valid email address . @param value The String value of the user ' s email address . @return Returns null if the value is null or whitespace only ; otherwise it returns the email address . @throws ValidationException Thrown if the email address is not a valid email address .
public static String validateEmailAddress(final String value) 
			throws ValidationException {
		LOGGER.info("Validating that an email address is valid.");
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		if(StringUtils.isValidEmailAddress(value.trim())) {
			return value.trim();
		}
		else {
			throw new ValidationException(
					ErrorCode.USER_INVALID_EMAIL_ADDRESS, 
					"The email address value for the user is invalid: " + 
						value);
		}
	}
public static String validateEmailAddress ( final String value ) throws ValidationException { LOGGER . info ( "Validating that an email address is valid." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } if ( StringUtils . isValidEmailAddress ( value . trim ( ) ) ) { return value . trim ( ) ; } else { throw new ValidationException ( ErrorCode . USER_INVALID_EMAIL_ADDRESS , "The email address value for the user is invalid: " + value ) ; } }
Validates that the email address for a user is a valid email address.
Validates that the email address for a user is a valid email address .