src/org/ohmage/validator/AuditValidators.java
public static ErrorCode validateErrorCode(final String errorCode) 
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(errorCode)) {
			return null;
		}
		
		try {
			return ErrorCode.getValue(errorCode);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.AUDIT_INVALID_ERROR_CODE, 
					"The error code is unknown: " + errorCode, 
					e);
		}
	}
/**
	 * Checks if the error is null or whitespace only in which case it returns
	 * null; otherwise it returns the error code which must be one of
	 * {@link org.ohmage.annotator.Annotator.ErrorCode ErrorCode}.
	 * 
	 * @param errorCode The error code to be validated.
	 * 
	 * @return Null if the error code was null or whitespace only; otherwise,
	 * 		   the error code is returned.
	 * 
	 * @throws ValidationException Never thrown.
	 */
Checks if the error is null or whitespace only in which case it returns
null; otherwise it returns the error code which must be one of
org.ohmage.annotator.Annotator.ErrorCode ErrorCode.

@param errorCode The error code to be validated.

@return Null if the error code was null or whitespace only; otherwise,
the error code is returned.

@throws ValidationException Never thrown.
Checks if the error is null or whitespace only in which case it returns null ; otherwise it returns the error code which must be one of org . ohmage . annotator . Annotator . ErrorCode ErrorCode . @param errorCode The error code to be validated . @return Null if the error code was null or whitespace only ; otherwise the error code is returned . @throws ValidationException Never thrown .
public static ErrorCode validateErrorCode(final String errorCode) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(errorCode)) {
			return null;
		}
		try {
			return ErrorCode.getValue(errorCode);
		}
		catch(IllegalArgumentException e) {
			throw new ValidationException(
					ErrorCode.AUDIT_INVALID_ERROR_CODE, 
					"The error code is unknown: " + errorCode, 
					e);
		}
	}
public static ErrorCode validateErrorCode ( final String errorCode ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( errorCode ) ) { return null ; } try { return ErrorCode . getValue ( errorCode ) ; } catch ( IllegalArgumentException e ) { throw new ValidationException ( ErrorCode . AUDIT_INVALID_ERROR_CODE , "The error code is unknown: " + errorCode , e ) ; } }
Checks if the error is null or whitespace only in which case it returns
 null; otherwise it returns the error code which must be one of
 {@link org.ohmage.annotator.Annotator.ErrorCode ErrorCode}.
Checks if the error is null or whitespace only in which case it returns null ; otherwise it returns the error code which must be one of { @link org . ohmage . annotator . Annotator . ErrorCode ErrorCode } .