src/org/ohmage/validator/CampaignValidators.java
public static OutputFormat validateOutputFormat(final String outputFormat) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(outputFormat)) {
			return null;
		}
		
		try {
			return OutputFormat.valueOf(outputFormat.trim().toUpperCase());
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_OUTPUT_FORMAT, 
					"Unknown output format: " + outputFormat, 
					e);
		}
	}
/**
	 * Validates that the output format is a valid output format.
	 * 
	 * @param outputFormat The output format String to be validated.
	 * 
	 * @return Returns null if the output format is null or whitespace only;
	 * 		   otherwise, it returns a new OutputFormat representing the output
	 * 		   format.
	 * 
	 * @throws ValidationException Thrown if the output format is not null, not
	 * 							   whitespace only, and not a valid output 
	 * 							   format.
	 */
Validates that the output format is a valid output format.

@param outputFormat The output format String to be validated.

@return Returns null if the output format is null or whitespace only;
otherwise, it returns a new OutputFormat representing the output
format.

@throws ValidationException Thrown if the output format is not null, not
whitespace only, and not a valid output
format.
Validates that the output format is a valid output format . @param outputFormat The output format String to be validated . @return Returns null if the output format is null or whitespace only ; otherwise it returns a new OutputFormat representing the output format . @throws ValidationException Thrown if the output format is not null not whitespace only and not a valid output format .
public static OutputFormat validateOutputFormat(final String outputFormat) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(outputFormat)) {
			return null;
		}
		try {
			return OutputFormat.valueOf(outputFormat.trim().toUpperCase());
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_OUTPUT_FORMAT, 
					"Unknown output format: " + outputFormat, 
					e);
		}
	}
public static OutputFormat validateOutputFormat ( final String outputFormat ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( outputFormat ) ) { return null ; } try { return OutputFormat . valueOf ( outputFormat . trim ( ) . toUpperCase ( ) ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . CAMPAIGN_INVALID_OUTPUT_FORMAT , "Unknown output format: " + outputFormat , e ) ; } }
Validates that the output format is a valid output format.
Validates that the output format is a valid output format .