src/org/ohmage/validator/DocumentValidators.java
public static String validateDescription(final String value) 
			throws ValidationException {
		
		LOGGER.info("Validating a document's description.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		if(StringUtils.isProfane(value.trim())) {
			throw new ValidationException(
					ErrorCode.DOCUMENT_INVALID_DESCRIPTION, 
					"The document's description contains profanity.");
		}
		else {
			return value.trim();
		}
	}
/**
	 * Validates that the description of a document does not contain profanity.
	 * 
	 * @param value The value 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 the description of a document does not contain profanity.

@param value The value 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 the description of a document does not contain profanity . @param value The value 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 value) 
			throws ValidationException {
		LOGGER.info("Validating a document's description.");
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		if(StringUtils.isProfane(value.trim())) {
			throw new ValidationException(
					ErrorCode.DOCUMENT_INVALID_DESCRIPTION, 
					"The document's description contains profanity.");
		}
		else {
			return value.trim();
		}
	}
public static String validateDescription ( final String value ) throws ValidationException { LOGGER . info ( "Validating a document's description." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } if ( StringUtils . isProfane ( value . trim ( ) ) ) { throw new ValidationException ( ErrorCode . DOCUMENT_INVALID_DESCRIPTION , "The document's description contains profanity." ) ; } else { return value . trim ( ) ; } }
Validates that the description of a document does not contain profanity.
Validates that the description of a document does not contain profanity .