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

@param promptId The prompt ID to be validated.

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

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