src/org/ohmage/validator/ClassValidators.java
public static String validateDescription(final String description) 
			throws ValidationException {
		
		LOGGER.info("Validating a class description.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(description)) {
			return null;
		}
		
		if(StringUtils.isProfane(description.trim())) {
			throw new ValidationException(
					ErrorCode.CLASS_INVALID_DESCRIPTION, 
					"The class description contains profanity: " + 
						description);
		}
		else {
			return description.trim();
		}
	}
/**
	 * Validates that a class description is a valid class description by 
	 * ensuring that it doesn't contain profanity.
	 * 
	 * @param description The description to be validated.
	 * 
	 * @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 class description is a valid class description by
ensuring that it doesn't contain profanity.

@param description The description to be validated.

@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 class description is a valid class description by ensuring that it doesn ' t contain profanity . @param description The description to be validated . @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 {
		LOGGER.info("Validating a class description.");
		if(StringUtils.isEmptyOrWhitespaceOnly(description)) {
			return null;
		}
		if(StringUtils.isProfane(description.trim())) {
			throw new ValidationException(
					ErrorCode.CLASS_INVALID_DESCRIPTION, 
					"The class description contains profanity: " + 
						description);
		}
		else {
			return description.trim();
		}
	}
public static String validateDescription ( final String description ) throws ValidationException { LOGGER . info ( "Validating a class description." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( description ) ) { return null ; } if ( StringUtils . isProfane ( description . trim ( ) ) ) { throw new ValidationException ( ErrorCode . CLASS_INVALID_DESCRIPTION , "The class description contains profanity: " + description ) ; } else { return description . trim ( ) ; } }
Validates that a class description is a valid class description by
 ensuring that it doesn't contain profanity.
Validates that a class description is a valid class description by ensuring that it doesn ' t contain profanity .