src/org/ohmage/validator/CampaignValidators.java
public static String validateDescription(final String description) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(description)) {
			return null;
		}
		
		if(StringUtils.isProfane(description.trim())) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_DESCRIPTION, 
					"The campaign description contains profanity: " + 
						description);
		}
		else {
			return description.trim();
		}
	}
/**
	 * Validates that a campaign description is valid by ensuring that it does
	 * not contain any profanity.
	 * 
	 * @param description The description to validate.
	 * 
	 * @return Returns null if the description is null or whitespace only;
	 * 		   otherwise, it returns the description.
	 * 
	 * @throws ValidationException Thrown if the description contains 
	 * 							   profanity.
	 */
Validates that a campaign description is valid by ensuring that it does
not contain any profanity.

@param description The description to validate.

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

@throws ValidationException Thrown if the description contains
profanity.
Validates that a campaign description is valid by ensuring that it does not contain any profanity . @param description The description to validate . @return Returns null if the description is null or whitespace only ; otherwise it returns the description . @throws ValidationException Thrown if the description contains profanity .
public static String validateDescription(final String description) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(description)) {
			return null;
		}
		if(StringUtils.isProfane(description.trim())) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_DESCRIPTION, 
					"The campaign description contains profanity: " + 
						description);
		}
		else {
			return description.trim();
		}
	}
public static String validateDescription ( final String description ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( description ) ) { return null ; } if ( StringUtils . isProfane ( description . trim ( ) ) ) { throw new ValidationException ( ErrorCode . CAMPAIGN_INVALID_DESCRIPTION , "The campaign description contains profanity: " + description ) ; } else { return description . trim ( ) ; } }
Validates that a campaign description is valid by ensuring that it does
 not contain any profanity.
Validates that a campaign description is valid by ensuring that it does not contain any profanity .