src/org/ohmage/validator/CampaignValidators.java
public static Map<String, String> validateXml(
			final String xml)
			throws ValidationException{
		
		if(StringUtils.isEmptyOrWhitespaceOnly(xml)) {
			return null;
		}
		
		try {
			return Campaign.validateXml(xml);
		}
		catch(DomainException e) {
			throw new ValidationException(
				ErrorCode.CAMPAIGN_INVALID_XML, 
				e.getMessage(), 
				e);
		}
	}
/**
	 * Validates a campaign's XML. If it is null or whitespace, this returns
	 * null. If it is invalid, this throws a ValidationException.
	 * 
	 * @param xml The campaign XML to be validated.
	 * 
	 * @return Returns null if the XML is null or whitespace only. Otherwise, 
	 * 		   it attempts to validate the XML, and if successful, it returns
	 * 		   the original XML. If unsuccessful, it will throw a 
	 * 		   ValidationException.
	 * 
	 * @throws ValidationException Thrown if the XML is not null, not 
	 * 							   whitespace only, and is invalid.
	 */
Validates a campaign's XML. If it is null or whitespace, this returns
null. If it is invalid, this throws a ValidationException.

@param xml The campaign XML to be validated.

@return Returns null if the XML is null or whitespace only. Otherwise,
it attempts to validate the XML, and if successful, it returns
the original XML. If unsuccessful, it will throw a
ValidationException.

@throws ValidationException Thrown if the XML is not null, not
whitespace only, and is invalid.
Validates a campaign ' s XML . If it is null or whitespace this returns null . If it is invalid this throws a ValidationException . @param xml The campaign XML to be validated . @return Returns null if the XML is null or whitespace only . Otherwise it attempts to validate the XML and if successful it returns the original XML . If unsuccessful it will throw a ValidationException . @throws ValidationException Thrown if the XML is not null not whitespace only and is invalid .
public static Map<String, String> validateXml(
			final String xml)
			throws ValidationException{
		if(StringUtils.isEmptyOrWhitespaceOnly(xml)) {
			return null;
		}
		try {
			return Campaign.validateXml(xml);
		}
		catch(DomainException e) {
			throw new ValidationException(
				ErrorCode.CAMPAIGN_INVALID_XML, 
				e.getMessage(), 
				e);
		}
	}
public static Map < String , String > validateXml ( final String xml ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( xml ) ) { return null ; } try { return Campaign . validateXml ( xml ) ; } catch ( DomainException e ) { throw new ValidationException ( ErrorCode . CAMPAIGN_INVALID_XML , e . getMessage ( ) , e ) ; } }
Validates a campaign's XML.
Validates a campaign ' s XML .