src/org/ohmage/validator/ClassValidators.java
public static String validateClassId(final String classId) 
			throws ValidationException {
		
		// If the value is null or whitespace only, return null.
		if(StringUtils.isEmptyOrWhitespaceOnly(classId)) {
			return null;
		}
		
		// If the value is a valid URN, meaning that it is a plausible class 
		// ID, return the class ID back to the caller.
		if(StringUtils.isValidUrn(classId.trim())) {
			return classId.trim();
		}
		// If the class ID is not null, not whitespace only, and not a valid
		// URN, set the request as failed and throw a ValidationException to
		// warn the caller.
		else {
			throw new ValidationException(
					ErrorCode.CLASS_INVALID_ID, 
					"The class identifier is invalid: " + classId);
		}
	}
/**
	 * Validates that the 'classId' is either null or whitespace only in which
	 * case null is returned or is a valid class identifier in which case the 
	 * class ID is returned; however, if it is not null, not whitespace only,  
	 * and not a valid class identifier, a ValidationException is thrown.
	 *  
	 * @param classId The class identifier to be validated.
	 * 
	 * @return Returns the class ID if it is not null, not whitespace, and 
	 * 		   valid. If it is null or whitespace only, null is returned.
	 * 
	 * @throws ValidationException Thrown if the class ID is not null, not
	 * 		   whitespace only, and not a valid class ID.
	 */
Validates that the 'classId' is either null or whitespace only in which
case null is returned or is a valid class identifier in which case the
class ID is returned; however, if it is not null, not whitespace only,
and not a valid class identifier, a ValidationException is thrown.

@param classId The class identifier to be validated.

@return Returns the class ID if it is not null, not whitespace, and
valid. If it is null or whitespace only, null is returned.

@throws ValidationException Thrown if the class ID is not null, not
whitespace only, and not a valid class ID.
Validates that the ' classId ' is either null or whitespace only in which case null is returned or is a valid class identifier in which case the class ID is returned ; however if it is not null not whitespace only and not a valid class identifier a ValidationException is thrown . @param classId The class identifier to be validated . @return Returns the class ID if it is not null not whitespace and valid . If it is null or whitespace only null is returned . @throws ValidationException Thrown if the class ID is not null not whitespace only and not a valid class ID .
public static String validateClassId(final String classId) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(classId)) {
			return null;
		}
		if(StringUtils.isValidUrn(classId.trim())) {
			return classId.trim();
		}
		else {
			throw new ValidationException(
					ErrorCode.CLASS_INVALID_ID, 
					"The class identifier is invalid: " + classId);
		}
	}
public static String validateClassId ( final String classId ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( classId ) ) { return null ; } if ( StringUtils . isValidUrn ( classId . trim ( ) ) ) { return classId . trim ( ) ; } else { throw new ValidationException ( ErrorCode . CLASS_INVALID_ID , "The class identifier is invalid: " + classId ) ; } }
Validates that the 'classId' is either null or whitespace only in which
 case null is returned or is a valid class identifier in which case the
 class ID is returned; however, if it is not null, not whitespace only,
 and not a valid class identifier, a ValidationException is thrown.
Validates that the ' classId ' is either null or whitespace only in which case null is returned or is a valid class identifier in which case the class ID is returned ; however if it is not null not whitespace only and not a valid class identifier a ValidationException is thrown .
// If the value is null or whitespace only, return null. // If the value is a valid URN, meaning that it is a plausible class  // ID, return the class ID back to the caller. // If the class ID is not null, not whitespace only, and not a valid // URN, set the request as failed and throw a ValidationException to // warn the caller.