src/org/ohmage/validator/UserValidators.java
public static String validateOrganization(final String value) 
			throws ValidationException {
		
		LOGGER.info("Validating that an organization name value is valid.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		if(StringUtils.isProfane(value.trim())) {
			throw new ValidationException(
					ErrorCode.USER_INVALID_ORGANIZATION_VALUE, 
					"The organization value for the user contains profanity: " + 
						value);
		}
		else if(! StringUtils.lengthWithinLimits(value.trim(), 0, MAX_ORGANIZATION_LENGTH)) {
			throw new ValidationException(
					ErrorCode.USER_INVALID_ORGANIZATION_VALUE, 
					"The organization value for the user is too long. The limit is " + 
						MAX_ORGANIZATION_LENGTH + 
						" characters.");
		}
		else {
			return value.trim();
		}
	}
/**
	 * Validates that the organization value for a user is a valid organization
	 * value.
	 * 
	 * @param value The String value of the user's organization.
	 * 
	 * @return Returns null if the value is null or whitespace only; otherwise,
	 * 		   it returns the organization value.
	 * 
	 * @throws ValidationException Thrown if the name contains profanity or if
	 * 							   its length is greater than 
	 * 							   {@value #MAX_ORGANIZATION_LENGTH}.
	 */
Validates that the organization value for a user is a valid organization
value.

@param value The String value of the user's organization.

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

@throws ValidationException Thrown if the name contains profanity or if
its length is greater than
#MAX_ORGANIZATION_LENGTH.
Validates that the organization value for a user is a valid organization value . @param value The String value of the user ' s organization . @return Returns null if the value is null or whitespace only ; otherwise it returns the organization value . @throws ValidationException Thrown if the name contains profanity or if its length is greater than #MAX_ORGANIZATION_LENGTH .
public static String validateOrganization(final String value) 
			throws ValidationException {
		LOGGER.info("Validating that an organization name value is valid.");
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		if(StringUtils.isProfane(value.trim())) {
			throw new ValidationException(
					ErrorCode.USER_INVALID_ORGANIZATION_VALUE, 
					"The organization value for the user contains profanity: " + 
						value);
		}
		else if(! StringUtils.lengthWithinLimits(value.trim(), 0, MAX_ORGANIZATION_LENGTH)) {
			throw new ValidationException(
					ErrorCode.USER_INVALID_ORGANIZATION_VALUE, 
					"The organization value for the user is too long. The limit is " + 
						MAX_ORGANIZATION_LENGTH + 
						" characters.");
		}
		else {
			return value.trim();
		}
	}
public static String validateOrganization ( final String value ) throws ValidationException { LOGGER . info ( "Validating that an organization name value is valid." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } if ( StringUtils . isProfane ( value . trim ( ) ) ) { throw new ValidationException ( ErrorCode . USER_INVALID_ORGANIZATION_VALUE , "The organization value for the user contains profanity: " + value ) ; } else if ( ! StringUtils . lengthWithinLimits ( value . trim ( ) , 0 , MAX_ORGANIZATION_LENGTH ) ) { throw new ValidationException ( ErrorCode . USER_INVALID_ORGANIZATION_VALUE , "The organization value for the user is too long. The limit is " + MAX_ORGANIZATION_LENGTH + " characters." ) ; } else { return value . trim ( ) ; } }
Validates that the organization value for a user is a valid organization
 value.
Validates that the organization value for a user is a valid organization value .