src/org/ohmage/validator/SurveyResponseValidators.java
public static OutputFormat validateOutputFormat(final String outputFormat) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(outputFormat)) {
			return null;
		}
		
		try {
			return OutputFormat.getValue(outputFormat);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SURVEY_INVALID_OUTPUT_FORMAT, 
					"The output format is unknown: " + outputFormat);
		}
	}
/**
	 * Validates that a string value represents a known output format value.
	 * 
	 * @param outputFormat The output format as a string.
	 * 
	 * @return An OutputFormat object, or null if the output format string was
	 * 		   null or whitespace only.
	 * 
	 * @throws ValidationException Thrown if the output format is unknown.
	 */
Validates that a string value represents a known output format value.

@param outputFormat The output format as a string.

@return An OutputFormat object, or null if the output format string was
null or whitespace only.

@throws ValidationException Thrown if the output format is unknown.
Validates that a string value represents a known output format value . @param outputFormat The output format as a string . @return An OutputFormat object or null if the output format string was null or whitespace only . @throws ValidationException Thrown if the output format is unknown .
public static OutputFormat validateOutputFormat(final String outputFormat) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(outputFormat)) {
			return null;
		}
		try {
			return OutputFormat.getValue(outputFormat);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.SURVEY_INVALID_OUTPUT_FORMAT, 
					"The output format is unknown: " + outputFormat);
		}
	}
public static OutputFormat validateOutputFormat ( final String outputFormat ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( outputFormat ) ) { return null ; } try { return OutputFormat . getValue ( outputFormat ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . SURVEY_INVALID_OUTPUT_FORMAT , "The output format is unknown: " + outputFormat ) ; } }
Validates that a string value represents a known output format value.
Validates that a string value represents a known output format value .