src/org/ohmage/validator/ClassValidators.java
public static Set<String> validateClassIdList(
			final String classIdListString) throws ValidationException {
		
		LOGGER.info("Validating the list of classes.");
		
		// If the class list is an empty string, then we return null.
		if(StringUtils.isEmptyOrWhitespaceOnly(classIdListString)) {
			return null;
		}
		
		// Create the list of class IDs to be returned to the caller.
		Set<String> classIdList = new HashSet<String>();
		
		// Otherwise, attempt to parse the class list and evaluate each of the
		// class IDs.
		String[] classListArray = classIdListString.split(InputKeys.LIST_ITEM_SEPARATOR);
		for(int i = 0; i < classListArray.length; i++) {
			// Validate the current class ID.
			String currClassId = validateClassId(classListArray[i].trim());
			
			// If it returned null, then the current class ID in the array
			// was probably whitespace only because the class list had two
			// list item separators in a row.
			if(currClassId != null) {
				classIdList.add(currClassId);
			}
		}
		
		if(classIdList.size() == 0) {
			return null;
		}
		else {
			return classIdList;
		}
	}
/**
	 * Validates that all of the class identifiers in a list String are valid 
	 * class identifiers. If the class identifier list String is null or 
	 * whitespace only, it will return null. If not, it will attempt to parse
	 * the String and evaluate each of the class identifiers in the list. If 
	 * any are invalid, it will return an error message stating which one in
	 * the list was invalid.
	 *  
	 * @param classIdListString The class list as a String where each item is
	 * 							separated by
	 * 						  	{@value org.ohmage.request.InputKeys#LIST_ITEM_SEPARATOR}.
	 * 
	 * @return Returns a List of class identifiers from the 'classListString'
	 * 		   or null if the class ID list String is null, whitespace only, or
	 * 		   would otherwise be empty because it doesn't contain any 
	 * 		   meaningful data.
	 * 
	 * @throws ValidationException Thrown if the class Id list String contains a
	 * 							  class ID that is an invalid class ID.
	 */
Validates that all of the class identifiers in a list String are valid
class identifiers. If the class identifier list String is null or
whitespace only, it will return null. If not, it will attempt to parse
the String and evaluate each of the class identifiers in the list. If
any are invalid, it will return an error message stating which one in
the list was invalid.

@param classIdListString The class list as a String where each item is
separated by
org.ohmage.request.InputKeys#LIST_ITEM_SEPARATOR.

@return Returns a List of class identifiers from the 'classListString'
or null if the class ID list String is null, whitespace only, or
would otherwise be empty because it doesn't contain any
meaningful data.

@throws ValidationException Thrown if the class Id list String contains a
class ID that is an invalid class ID.
Validates that all of the class identifiers in a list String are valid class identifiers . If the class identifier list String is null or whitespace only it will return null . If not it will attempt to parse the String and evaluate each of the class identifiers in the list . If any are invalid it will return an error message stating which one in the list was invalid . @param classIdListString The class list as a String where each item is separated by org . ohmage . request . InputKeys#LIST_ITEM_SEPARATOR . @return Returns a List of class identifiers from the ' classListString ' or null if the class ID list String is null whitespace only or would otherwise be empty because it doesn ' t contain any meaningful data . @throws ValidationException Thrown if the class Id list String contains a class ID that is an invalid class ID .
public static Set<String> validateClassIdList(
			final String classIdListString) throws ValidationException {
		LOGGER.info("Validating the list of classes.");
		if(StringUtils.isEmptyOrWhitespaceOnly(classIdListString)) {
			return null;
		}
		Set<String> classIdList = new HashSet<String>();
		String[] classListArray = classIdListString.split(InputKeys.LIST_ITEM_SEPARATOR);
		for(int i = 0; i < classListArray.length; i++) {
			String currClassId = validateClassId(classListArray[i].trim());
			if(currClassId != null) {
				classIdList.add(currClassId);
			}
		}
		if(classIdList.size() == 0) {
			return null;
		}
		else {
			return classIdList;
		}
	}
public static Set < String > validateClassIdList ( final String classIdListString ) throws ValidationException { LOGGER . info ( "Validating the list of classes." ) ; if ( StringUtils . isEmptyOrWhitespaceOnly ( classIdListString ) ) { return null ; } Set < String > classIdList = new HashSet < String > ( ) ; String [ ] classListArray = classIdListString . split ( InputKeys . LIST_ITEM_SEPARATOR ) ; for ( int i = 0 ; i < classListArray . length ; i ++ ) { String currClassId = validateClassId ( classListArray [ i ] . trim ( ) ) ; if ( currClassId != null ) { classIdList . add ( currClassId ) ; } } if ( classIdList . size ( ) == 0 ) { return null ; } else { return classIdList ; } }
Validates that all of the class identifiers in a list String are valid
 class identifiers.
Validates that all of the class identifiers in a list String are valid class identifiers .
// If the class list is an empty string, then we return null. // Create the list of class IDs to be returned to the caller. // Otherwise, attempt to parse the class list and evaluate each of the // class IDs. // Validate the current class ID. // If it returned null, then the current class ID in the array // was probably whitespace only because the class list had two // list item separators in a row.