src/org/ohmage/domain/campaign/Campaign.java
public static final String validateSurveyId(
			final String surveyId)
			throws DomainException {
		
		if(surveyId == null) {
			throw new DomainException("The survey ID is null.");
		}
		
		String trimmedSurveyId = surveyId.trim();
		if(trimmedSurveyId.length() == 0) {
			throw new DomainException(
					"The survey's ID cannot be only whitespace.");
		}
		else if(! VALID_CHARACTERS_PATTERN.matcher(trimmedSurveyId).matches()) {
			throw new DomainException(
				"The survey's ID contains illegal characters: " + 
					trimmedSurveyId);
		}
		
		return trimmedSurveyId;
	}
/**
	 * Validates that a survey ID conforms to our specification.
	 * 
	 * @param surveyId The survey ID to validate.
	 * 
	 * @return The validated survey ID.
	 * 
	 * @throws DomainException The survey ID is invalid.
	 */
Validates that a survey ID conforms to our specification.

@param surveyId The survey ID to validate.

@return The validated survey ID.

@throws DomainException The survey ID is invalid.
Validates that a survey ID conforms to our specification . @param surveyId The survey ID to validate . @return The validated survey ID . @throws DomainException The survey ID is invalid .
public static final String validateSurveyId(
			final String surveyId)
			throws DomainException {
		if(surveyId == null) {
			throw new DomainException("The survey ID is null.");
		}
		String trimmedSurveyId = surveyId.trim();
		if(trimmedSurveyId.length() == 0) {
			throw new DomainException(
					"The survey's ID cannot be only whitespace.");
		}
		else if(! VALID_CHARACTERS_PATTERN.matcher(trimmedSurveyId).matches()) {
			throw new DomainException(
				"The survey's ID contains illegal characters: " + 
					trimmedSurveyId);
		}
		return trimmedSurveyId;
	}
public static final String validateSurveyId ( final String surveyId ) throws DomainException { if ( surveyId == null ) { throw new DomainException ( "The survey ID is null." ) ; } String trimmedSurveyId = surveyId . trim ( ) ; if ( trimmedSurveyId . length ( ) == 0 ) { throw new DomainException ( "The survey's ID cannot be only whitespace." ) ; } else if ( ! VALID_CHARACTERS_PATTERN . matcher ( trimmedSurveyId ) . matches ( ) ) { throw new DomainException ( "The survey's ID contains illegal characters: " + trimmedSurveyId ) ; } return trimmedSurveyId ; }
Validates that a survey ID conforms to our specification.
Validates that a survey ID conforms to our specification .