src/org/ohmage/domain/campaign/Campaign.java
private static HoursBeforeNowPrompt processHoursBeforeNow(
			final String id,
			final String condition, 
			final String unit, 
			final String text,
			final String explanationText, 
			final boolean skippable, 
			final String skipLabel, 
			final String displayLabel,
			final String defaultValue,
			final Map<String, LabelValuePair> properties, 
			final int index) 
			throws DomainException {
		
		// Create the decimal parser.
		DecimalFormat format = new DecimalFormat();
		format.setParseBigDecimal(true);
		
		BigDecimal min;
		try {
			LabelValuePair minVlp = 
				properties.get(HoursBeforeNowPrompt.XML_KEY_MIN);
			
			if(minVlp == null) {
				throw new DomainException(
						"Missing the '" +
							HoursBeforeNowPrompt.XML_KEY_MIN +
							"' property: " +
							id);
			}
			
			min = (BigDecimal) format.parse(minVlp.getLabel());
		}
		catch(ParseException e) {
			throw new DomainException(
					"The '" +
						HoursBeforeNowPrompt.XML_KEY_MIN +
						"' property is not a valid number: " +
						id, 
					e);
		}
		
		BigDecimal max;
		try {
			LabelValuePair maxVlp = 
				properties.get(HoursBeforeNowPrompt.XML_KEY_MAX);
			
			if(maxVlp == null) {
				throw new DomainException(
						"Missing the '" +
							HoursBeforeNowPrompt.XML_KEY_MAX +
							"' property: " +
							id);
			}
			
			max = (BigDecimal) format.parse(maxVlp.getLabel());
		}
		catch(ParseException e) {
			throw new DomainException(
					"The '" +
						HoursBeforeNowPrompt.XML_KEY_MAX +
						"' property is not valid number: " +
						id, 
					e);
		}
		
		BigDecimal parsedDefaultValue = null;
		try {
			if(defaultValue != null) {
				parsedDefaultValue = (BigDecimal) format.parse(defaultValue);
			}
		}
		catch(ParseException e) {
			throw new DomainException(
					"The default value is not a valid number: " +
						id);
		}
		
		return new HoursBeforeNowPrompt(
			id,
			condition,
			unit,
			text,
			explanationText,
			skippable,
			skipLabel,
			displayLabel,
			min,
			max,
			parsedDefaultValue,
			index);
	}
/**
	 * Processes a hours-before-now prompt and returns a HoursBeforeNowPrompt
	 * object.
	 * 
	 * @param id The prompt's unique identifier.
	 * 
	 * @param condition The condition value.
	 * 
	 * @param unit The prompt's visualization unit.
	 * 
	 * @param text The prompt's text value.
	 * 
	 * @param explanationText The prompt's explanation text value.
	 * 
	 * @param skippable Whether or not this prompt is skippable.
	 * 
	 * @param skipLabel The label to show to skip this prompt.
	 * 
	 * @param displayLabel The label for this display type.
	 * 
	 * @param defaultValue The default value given in the XML.
	 * 
	 * @param properties The properties defined in the XML for this prompt.
	 * 
	 * @param index The index of this prompt in its collection of survey items.
	 * 
	 * @return A HoursBeforeNowPrompt object.
	 * 
	 * @throws DomainException Thrown if the required properties are missing or
	 * 						   if any of the parameters are invalid.
	 */
Processes a hours-before-now prompt and returns a HoursBeforeNowPrompt
object.

@param id The prompt's unique identifier.

@param condition The condition value.

@param unit The prompt's visualization unit.

@param text The prompt's text value.

@param explanationText The prompt's explanation text value.

@param skippable Whether or not this prompt is skippable.

@param skipLabel The label to show to skip this prompt.

@param displayLabel The label for this display type.

@param defaultValue The default value given in the XML.

@param properties The properties defined in the XML for this prompt.

@param index The index of this prompt in its collection of survey items.

@return A HoursBeforeNowPrompt object.

@throws DomainException Thrown if the required properties are missing or
if any of the parameters are invalid.
Processes a hours - before - now prompt and returns a HoursBeforeNowPrompt object . @param id The prompt ' s unique identifier . @param condition The condition value . @param unit The prompt ' s visualization unit . @param text The prompt ' s text value . @param explanationText The prompt ' s explanation text value . @param skippable Whether or not this prompt is skippable . @param skipLabel The label to show to skip this prompt . @param displayLabel The label for this display type . @param defaultValue The default value given in the XML . @param properties The properties defined in the XML for this prompt . @param index The index of this prompt in its collection of survey items . @return A HoursBeforeNowPrompt object . @throws DomainException Thrown if the required properties are missing or if any of the parameters are invalid .
private static HoursBeforeNowPrompt processHoursBeforeNow(
			final String id,
			final String condition, 
			final String unit, 
			final String text,
			final String explanationText, 
			final boolean skippable, 
			final String skipLabel, 
			final String displayLabel,
			final String defaultValue,
			final Map<String, LabelValuePair> properties, 
			final int index) 
			throws DomainException {
		DecimalFormat format = new DecimalFormat();
		format.setParseBigDecimal(true);
		BigDecimal min;
		try {
			LabelValuePair minVlp = 
				properties.get(HoursBeforeNowPrompt.XML_KEY_MIN);
			if(minVlp == null) {
				throw new DomainException(
						"Missing the '" +
							HoursBeforeNowPrompt.XML_KEY_MIN +
							"' property: " +
							id);
			}
			min = (BigDecimal) format.parse(minVlp.getLabel());
		}
		catch(ParseException e) {
			throw new DomainException(
					"The '" +
						HoursBeforeNowPrompt.XML_KEY_MIN +
						"' property is not a valid number: " +
						id, 
					e);
		}
		BigDecimal max;
		try {
			LabelValuePair maxVlp = 
				properties.get(HoursBeforeNowPrompt.XML_KEY_MAX);
			if(maxVlp == null) {
				throw new DomainException(
						"Missing the '" +
							HoursBeforeNowPrompt.XML_KEY_MAX +
							"' property: " +
							id);
			}
			max = (BigDecimal) format.parse(maxVlp.getLabel());
		}
		catch(ParseException e) {
			throw new DomainException(
					"The '" +
						HoursBeforeNowPrompt.XML_KEY_MAX +
						"' property is not valid number: " +
						id, 
					e);
		}
		BigDecimal parsedDefaultValue = null;
		try {
			if(defaultValue != null) {
				parsedDefaultValue = (BigDecimal) format.parse(defaultValue);
			}
		}
		catch(ParseException e) {
			throw new DomainException(
					"The default value is not a valid number: " +
						id);
		}
		return new HoursBeforeNowPrompt(
			id,
			condition,
			unit,
			text,
			explanationText,
			skippable,
			skipLabel,
			displayLabel,
			min,
			max,
			parsedDefaultValue,
			index);
	}
private static HoursBeforeNowPrompt processHoursBeforeNow ( final String id , final String condition , final String unit , final String text , final String explanationText , final boolean skippable , final String skipLabel , final String displayLabel , final String defaultValue , final Map < String , LabelValuePair > properties , final int index ) throws DomainException { DecimalFormat format = new DecimalFormat ( ) ; format . setParseBigDecimal ( true ) ; BigDecimal min ; try { LabelValuePair minVlp = properties . get ( HoursBeforeNowPrompt . XML_KEY_MIN ) ; if ( minVlp == null ) { throw new DomainException ( "Missing the '" + HoursBeforeNowPrompt . XML_KEY_MIN + "' property: " + id ) ; } min = ( BigDecimal ) format . parse ( minVlp . getLabel ( ) ) ; } catch ( ParseException e ) { throw new DomainException ( "The '" + HoursBeforeNowPrompt . XML_KEY_MIN + "' property is not a valid number: " + id , e ) ; } BigDecimal max ; try { LabelValuePair maxVlp = properties . get ( HoursBeforeNowPrompt . XML_KEY_MAX ) ; if ( maxVlp == null ) { throw new DomainException ( "Missing the '" + HoursBeforeNowPrompt . XML_KEY_MAX + "' property: " + id ) ; } max = ( BigDecimal ) format . parse ( maxVlp . getLabel ( ) ) ; } catch ( ParseException e ) { throw new DomainException ( "The '" + HoursBeforeNowPrompt . XML_KEY_MAX + "' property is not valid number: " + id , e ) ; } BigDecimal parsedDefaultValue = null ; try { if ( defaultValue != null ) { parsedDefaultValue = ( BigDecimal ) format . parse ( defaultValue ) ; } } catch ( ParseException e ) { throw new DomainException ( "The default value is not a valid number: " + id ) ; } return new HoursBeforeNowPrompt ( id , condition , unit , text , explanationText , skippable , skipLabel , displayLabel , min , max , parsedDefaultValue , index ) ; }
Processes a hours-before-now prompt and returns a HoursBeforeNowPrompt
 object.
Processes a hours - before - now prompt and returns a HoursBeforeNowPrompt object .
// Create the decimal parser.