src/org/ohmage/validator/VisualizationValidators.java
public static Integer validateHeight(final String height) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(height)) {
			return null;
		}
		
		try {
			Integer result =  Integer.decode(height);
			
			if(result < 0) {
				throw new ValidationException(
						ErrorCode.VISUALIZATION_INVALID_WIDTH_VALUE, 
						"The image's width cannot be less than 0: " + result);
			}
			else if(result > MAX_IMAGE_DIMENSION) {
				throw new ValidationException(
						ErrorCode.VISUALIZATION_INVALID_WIDTH_VALUE, 
						"The image's width cannot be greater than " + 
							MAX_IMAGE_DIMENSION + 
							": " + 
							result);
			}
			else {
				return result;
			}
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.VISUALIZATION_INVALID_WIDTH_VALUE, 
					"The image's width is not a valid number: " + height, 
					e);
		}
	}
/**
	 * Validates that the desired image height is not less than 0 and not  
	 * greater than {@value #MAX_IMAGE_DIMENSION}.
	 * 
	 * @param height The height to be validated.
	 * 
	 * @return Returns null if the height is null or whitespace only. 
	 * 		   Otherwise, it returns a decoded value for the height.
	 * 
	 * @throws ValidationException Thrown if the height is not null, not 
	 * 							   whitespace only, and not a valid number or
	 * 							   a number that is out of bounds.
	 */
Validates that the desired image height is not less than 0 and not
greater than  #MAX_IMAGE_DIMENSION.

@param height The height to be validated.

@return Returns null if the height is null or whitespace only.
Otherwise, it returns a decoded value for the height.

@throws ValidationException Thrown if the height is not null, not
whitespace only, and not a valid number or
a number that is out of bounds.
Validates that the desired image height is not less than 0 and not greater than #MAX_IMAGE_DIMENSION . @param height The height to be validated . @return Returns null if the height is null or whitespace only . Otherwise it returns a decoded value for the height . @throws ValidationException Thrown if the height is not null not whitespace only and not a valid number or a number that is out of bounds .
public static Integer validateHeight(final String height) 
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(height)) {
			return null;
		}
		try {
			Integer result =  Integer.decode(height);
			if(result < 0) {
				throw new ValidationException(
						ErrorCode.VISUALIZATION_INVALID_WIDTH_VALUE, 
						"The image's width cannot be less than 0: " + result);
			}
			else if(result > MAX_IMAGE_DIMENSION) {
				throw new ValidationException(
						ErrorCode.VISUALIZATION_INVALID_WIDTH_VALUE, 
						"The image's width cannot be greater than " + 
							MAX_IMAGE_DIMENSION + 
							": " + 
							result);
			}
			else {
				return result;
			}
		}
		catch(NumberFormatException e) {
			throw new ValidationException(
					ErrorCode.VISUALIZATION_INVALID_WIDTH_VALUE, 
					"The image's width is not a valid number: " + height, 
					e);
		}
	}
public static Integer validateHeight ( final String height ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( height ) ) { return null ; } try { Integer result = Integer . decode ( height ) ; if ( result < 0 ) { throw new ValidationException ( ErrorCode . VISUALIZATION_INVALID_WIDTH_VALUE , "The image's width cannot be less than 0: " + result ) ; } else if ( result > MAX_IMAGE_DIMENSION ) { throw new ValidationException ( ErrorCode . VISUALIZATION_INVALID_WIDTH_VALUE , "The image's width cannot be greater than " + MAX_IMAGE_DIMENSION + ": " + result ) ; } else { return result ; } } catch ( NumberFormatException e ) { throw new ValidationException ( ErrorCode . VISUALIZATION_INVALID_WIDTH_VALUE , "The image's width is not a valid number: " + height , e ) ; } }
Validates that the desired image height is not less than 0 and not
 greater than {@value #MAX_IMAGE_DIMENSION}.
Validates that the desired image height is not less than 0 and not greater than { @value #MAX_IMAGE_DIMENSION } .