src/org/ohmage/validator/ObserverValidators.java
public static final JsonParser validateData(
			final String value)
			throws ValidationException {
		
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		
		try {
			return (new MappingJsonFactory()).createJsonParser(value);
		}
		catch(JsonParseException e) {
			throw
				new ValidationException(
					ErrorCode.OBSERVER_INVALID_STREAM_DATA,
					"The data is not valid JSON.",
					e);
		}
		catch(IOException e) {
			throw new ValidationException("The data could not be read.", e);
		}
	}
/**
	 * Decodes the uploaded data as a JSON array of JSON objects.
	 * 
	 * @param value The value to be validated.
	 * 
	 * @return A collection of JSONObjects or null if the value was null or 
	 * 		   only whitespace.
	 * 
	 * @throws ValidationException The data is invalid.
	 */
Decodes the uploaded data as a JSON array of JSON objects.

@param value The value to be validated.

@return A collection of JSONObjects or null if the value was null or
only whitespace.

@throws ValidationException The data is invalid.
Decodes the uploaded data as a JSON array of JSON objects . @param value The value to be validated . @return A collection of JSONObjects or null if the value was null or only whitespace . @throws ValidationException The data is invalid .
public static final JsonParser validateData(
			final String value)
			throws ValidationException {
		if(StringUtils.isEmptyOrWhitespaceOnly(value)) {
			return null;
		}
		try {
			return (new MappingJsonFactory()).createJsonParser(value);
		}
		catch(JsonParseException e) {
			throw
				new ValidationException(
					ErrorCode.OBSERVER_INVALID_STREAM_DATA,
					"The data is not valid JSON.",
					e);
		}
		catch(IOException e) {
			throw new ValidationException("The data could not be read.", e);
		}
	}
public static final JsonParser validateData ( final String value ) throws ValidationException { if ( StringUtils . isEmptyOrWhitespaceOnly ( value ) ) { return null ; } try { return ( new MappingJsonFactory ( ) ) . createJsonParser ( value ) ; } catch ( JsonParseException e ) { throw new ValidationException ( ErrorCode . OBSERVER_INVALID_STREAM_DATA , "The data is not valid JSON." , e ) ; } catch ( IOException e ) { throw new ValidationException ( "The data could not be read." , e ) ; } }
Decodes the uploaded data as a JSON array of JSON objects.
Decodes the uploaded data as a JSON array of JSON objects .