src/org/ohmage/domain/campaign/Campaign.java
public static final String validatePromptId(
			final String promptId,
			final String containerId)
			throws DomainException {
		
		if(promptId == null) {
			throw new DomainException("The prompt ID is null.");
		}
		
		String trimmedPromptId = promptId.trim();
		if(trimmedPromptId.length() == 0) {
			throw new DomainException(
				"The prompt's ID cannot be only whitespace" +
					((containerId == null) ? "." : (": " + containerId)));
		}
		if(! VALID_CHARACTERS_PATTERN.matcher(trimmedPromptId).matches()) {
			throw new DomainException(
				"The prompt's ID contains illegal characters: " + 
					trimmedPromptId);
		}
		
		return trimmedPromptId;
	}
/**
	 * Validates that a prompt ID conforms to our specification.
	 * 
	 * @param promptId The prompt ID to validate.
	 * 
	 * @param containerId If this validation was part of a larger object, this 
	 * 					  may be provided to be appended to the exception's
	 * 					  message.
	 * 
	 * @return The validate prompt ID.
	 * 
	 * @throws DomainException The prompt ID was invalid.
	 */
Validates that a prompt ID conforms to our specification.

@param promptId The prompt ID to validate.

@param containerId If this validation was part of a larger object, this
may be provided to be appended to the exception's
message.

@return The validate prompt ID.

@throws DomainException The prompt ID was invalid.
Validates that a prompt ID conforms to our specification . @param promptId The prompt ID to validate . @param containerId If this validation was part of a larger object this may be provided to be appended to the exception ' s message . @return The validate prompt ID . @throws DomainException The prompt ID was invalid .
public static final String validatePromptId(
			final String promptId,
			final String containerId)
			throws DomainException {
		if(promptId == null) {
			throw new DomainException("The prompt ID is null.");
		}
		String trimmedPromptId = promptId.trim();
		if(trimmedPromptId.length() == 0) {
			throw new DomainException(
				"The prompt's ID cannot be only whitespace" +
					((containerId == null) ? "." : (": " + containerId)));
		}
		if(! VALID_CHARACTERS_PATTERN.matcher(trimmedPromptId).matches()) {
			throw new DomainException(
				"The prompt's ID contains illegal characters: " + 
					trimmedPromptId);
		}
		return trimmedPromptId;
	}
public static final String validatePromptId ( final String promptId , final String containerId ) throws DomainException { if ( promptId == null ) { throw new DomainException ( "The prompt ID is null." ) ; } String trimmedPromptId = promptId . trim ( ) ; if ( trimmedPromptId . length ( ) == 0 ) { throw new DomainException ( "The prompt's ID cannot be only whitespace" + ( ( containerId == null ) ? "." : ( ": " + containerId ) ) ) ; } if ( ! VALID_CHARACTERS_PATTERN . matcher ( trimmedPromptId ) . matches ( ) ) { throw new DomainException ( "The prompt's ID contains illegal characters: " + trimmedPromptId ) ; } return trimmedPromptId ; }
Validates that a prompt ID conforms to our specification.
Validates that a prompt ID conforms to our specification .