src/org/ohmage/validator/CampaignValidators.java
public static Campaign validateCampaign(
			final String id,
			final String name,
			final String xml,
			final String description,
			final Campaign.RunningState runningState,
			final Campaign.PrivacyState privacyState,
			final Date creationTimestamp,
			final Boolean editable) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(xml)) {
			return null;
		}
		
		try {
			return 
				new Campaign(
					id,
					name,
					description, 
					runningState, 
					privacyState, 
					creationTimestamp, 
					xml,
					editable);
		}
		catch(DomainException e) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_XML, 
					e.getMessage(), 
					e);
		}
	}
/**
	 * Validates a campaign's XML and creates a Campaign object from it and the
	 * other parameters.
	 * 
	 * @param id The campaign's ID.
	 * 
	 * @param name The campaign's name.
	 * 
	 * @param xml The XML to be validated.
	 * 
	 * @param description The description of the campaign or null.
	 * 
	 * @param runningState The running state of the campaign.
	 * 
	 * @param privacyState The privacy state of the campaign.
	 * 
	 * @param creationTimestamp The creation timestamp for this campaign.
	 * 
	 * @return The Campaign object.
	 * 
	 * @throws ValidationException The XML was not valid.
	 */
Validates a campaign's XML and creates a Campaign object from it and the
other parameters.

@param id The campaign's ID.

@param name The campaign's name.

@param xml The XML to be validated.

@param description The description of the campaign or null.

@param runningState The running state of the campaign.

@param privacyState The privacy state of the campaign.

@param creationTimestamp The creation timestamp for this campaign.

@return The Campaign object.

@throws ValidationException The XML was not valid.
Validates a campaign ' s XML and creates a Campaign object from it and the other parameters . @param id The campaign ' s ID . @param name The campaign ' s name . @param xml The XML to be validated . @param description The description of the campaign or null . @param runningState The running state of the campaign . @param privacyState The privacy state of the campaign . @param creationTimestamp The creation timestamp for this campaign . @return The Campaign object . @throws ValidationException The XML was not valid .
public static Campaign validateCampaign(
			final String id,
			final String name,
			final String xml,
			final String description,
			final Campaign.RunningState runningState,
			final Campaign.PrivacyState privacyState,
			final Date creationTimestamp,
			final Boolean editable) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(xml)) {
			return null;
		}
		try {
			return 
				new Campaign(
					id,
					name,
					description, 
					runningState, 
					privacyState, 
					creationTimestamp, 
					xml,
					editable);
		}
		catch(DomainException e) {
			throw new ValidationException(
					ErrorCode.CAMPAIGN_INVALID_XML, 
					e.getMessage(), 
					e);
		}
	}
public static Campaign validateCampaign ( final String id , final String name , final String xml , final String description , final Campaign . RunningState runningState , final Campaign . PrivacyState privacyState , final Date creationTimestamp , final Boolean editable ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( xml ) ) { return null ; } try { return new Campaign ( id , name , description , runningState , privacyState , creationTimestamp , xml , editable ) ; } catch ( DomainException e ) { throw new ValidationException ( ErrorCode . CAMPAIGN_INVALID_XML , e . getMessage ( ) , e ) ; } }
Validates a campaign's XML and creates a Campaign object from it and the
 other parameters.
Validates a campaign ' s XML and creates a Campaign object from it and the other parameters .