src/org/ohmage/validator/CampaignValidators.java
public static String validateSurveyId(final String surveyId) 
			throws ValidationException {
		LOGGER.info("Validating a campaign's survey ID.");
		
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyId)) {
			return null;
		}
		
		try {
			return Campaign.validateSurveyId(surveyId);
		}
		catch(DomainException e) {
			throw new ValidationException(
				ErrorCode.CAMPAIGN_INVALID_SURVEY_ID,
				"The survey ID is invalid: " + surveyId,
				e);
		}
	}
/**
	 * Validates that a campaign's XML's survey ID follows our conventions. It
	 * does _not_ validate that the survey ID is exists in the XML.
	 * 
	 * @param surveyId The survey ID to be validated.
	 * 
	 * @return Returns null if the survey ID is null or whitespace only; 
	 * 		   otherwise, it returns the survey ID.
	 * 
	 * @throws ValidationException Thrown if the survey ID is not null, not
	 * 							   whitespace only, and doesn't pass syntactic
	 * 							   validation.
	 */
Validates that a campaign's XML's survey ID follows our conventions. It
does _not_ validate that the survey ID is exists in the XML.

@param surveyId The survey ID to be validated.

@return Returns null if the survey ID is null or whitespace only;
otherwise, it returns the survey ID.

@throws ValidationException Thrown if the survey ID is not null, not
whitespace only, and doesn't pass syntactic
validation.
Validates that a campaign ' s XML ' s survey ID follows our conventions . It does _not_ validate that the survey ID is exists in the XML . @param surveyId The survey ID to be validated . @return Returns null if the survey ID is null or whitespace only ; otherwise it returns the survey ID . @throws ValidationException Thrown if the survey ID is not null not whitespace only and doesn ' t pass syntactic validation .
public static String validateSurveyId(final String surveyId) 
			throws ValidationException {
		LOGGER.info("Validating a campaign's survey ID.");
		if(StringUtils.isEmptyOrWhitespaceOnly(surveyId)) {
			return null;
		}
		try {
			return Campaign.validateSurveyId(surveyId);
		}
		catch(DomainException e) {
			throw new ValidationException(
				ErrorCode.CAMPAIGN_INVALID_SURVEY_ID,
				"The survey ID is invalid: " + surveyId,
				e);
		}
	}
public static String validateSurveyId ( final String surveyId ) throws ValidationException { LOGGER . info ( "Validating a campaign's survey ID." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( surveyId ) ) { return null ; } try { return Campaign . validateSurveyId ( surveyId ) ; } catch ( DomainException e ) { throw new ValidationException ( ErrorCode . CAMPAIGN_INVALID_SURVEY_ID , "The survey ID is invalid: " + surveyId , e ) ; } }
Validates that a campaign's XML's survey ID follows our conventions.
Validates that a campaign ' s XML ' s survey ID follows our conventions .