src/org/ohmage/domain/campaign/Campaign.java
private static List<SurveyItem> processContentList(
			final String surveyId,
			final Nodes contentListItems) 
			throws DomainException {
		
		int numItems = contentListItems.size();
		List<SurveyItem> result = new ArrayList<SurveyItem>(numItems);  // order matters
		
		for(int i = 0; i < numItems; i++) {
			SurveyItem.Type contentListItem;
			try {
				contentListItem = SurveyItem.Type.getValue(
						((Element) contentListItems.get(i)).getLocalName());
			}
			catch(IllegalArgumentException e) {
				throw new DomainException(
						"There were unknown content list items found: " + 
							surveyId, 
						e);
			}
				
			switch(contentListItem) {
			case MESSAGE:
				result.add(
						processMessage(
								surveyId, 
								contentListItems.get(i), 
								i,
								result));
				break;
				
			case REPEATABLE_SET:
				result.add(
						processRepeatableSet(
								surveyId, 
								contentListItems.get(i), 
								i,
								result));
				break;
				
			case PROMPT:
				result.add(
						processPrompt(
								surveyId, 
								contentListItems.get(i), 
								i,
								result));
				break;
				
			default:
				throw new DomainException(
						"There are new content list items but no matching processor for survey '" + 
							surveyId + 
							"': " + 
							contentListItem);
			}
		}
		
		return result;
	}
/**
	 * Processes the content list items from the XML.
	 * 
	 * @param surveyId The unique identifier for the survey that is contains
	 * 				   this content list.
	 * 
	 * @param contentListItems The Nodes from the XML that define the content
	 * 						   list.
	 * 
	 * @return A list of AbstractPrompts that were generated from the XML.
	 * 
	 * @throws DomainException Thrown if one of the content list items is 
	 * 						   malformed.
	 */
Processes the content list items from the XML.

@param surveyId The unique identifier for the survey that is contains
this content list.

@param contentListItems The Nodes from the XML that define the content
list.

@return A list of AbstractPrompts that were generated from the XML.

@throws DomainException Thrown if one of the content list items is
malformed.
Processes the content list items from the XML . @param surveyId The unique identifier for the survey that is contains this content list . @param contentListItems The Nodes from the XML that define the content list . @return A list of AbstractPrompts that were generated from the XML . @throws DomainException Thrown if one of the content list items is malformed .
private static List<SurveyItem> processContentList(
			final String surveyId,
			final Nodes contentListItems) 
			throws DomainException {
		int numItems = contentListItems.size();
		List<SurveyItem> result = new ArrayList<SurveyItem>(numItems);  
		for(int i = 0; i < numItems; i++) {
			SurveyItem.Type contentListItem;
			try {
				contentListItem = SurveyItem.Type.getValue(
						((Element) contentListItems.get(i)).getLocalName());
			}
			catch(IllegalArgumentException e) {
				throw new DomainException(
						"There were unknown content list items found: " + 
							surveyId, 
						e);
			}
			switch(contentListItem) {
			case MESSAGE:
				result.add(
						processMessage(
								surveyId, 
								contentListItems.get(i), 
								i,
								result));
				break;
			case REPEATABLE_SET:
				result.add(
						processRepeatableSet(
								surveyId, 
								contentListItems.get(i), 
								i,
								result));
				break;
			case PROMPT:
				result.add(
						processPrompt(
								surveyId, 
								contentListItems.get(i), 
								i,
								result));
				break;
			default:
				throw new DomainException(
						"There are new content list items but no matching processor for survey '" + 
							surveyId + 
							"': " + 
							contentListItem);
			}
		}
		return result;
	}
private static List < SurveyItem > processContentList ( final String surveyId , final Nodes contentListItems ) throws DomainException { int numItems = contentListItems . size ( ) ; List < SurveyItem > result = new ArrayList < SurveyItem > ( numItems ) ; for ( int i = 0 ; i < numItems ; i ++ ) { SurveyItem . Type contentListItem ; try { contentListItem = SurveyItem . Type . getValue ( ( ( Element ) contentListItems . get ( i ) ) . getLocalName ( ) ) ; } catch ( IllegalArgumentException e ) { throw new DomainException ( "There were unknown content list items found: " + surveyId , e ) ; } switch ( contentListItem ) { case MESSAGE : result . add ( processMessage ( surveyId , contentListItems . get ( i ) , i , result ) ) ; break ; case REPEATABLE_SET : result . add ( processRepeatableSet ( surveyId , contentListItems . get ( i ) , i , result ) ) ; break ; case PROMPT : result . add ( processPrompt ( surveyId , contentListItems . get ( i ) , i , result ) ) ; break ; default : throw new DomainException ( "There are new content list items but no matching processor for survey '" + surveyId + "': " + contentListItem ) ; } } return result ; }
Processes the content list items from the XML.
Processes the content list items from the XML .
// order matters