src/org/ohmage/domain/campaign/Campaign.java
private static TextPrompt processText(
			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 {
		
		int min;
		try {
			LabelValuePair minVlp = 
				properties.get(NumberPrompt.XML_KEY_MIN);
			
			if(minVlp == null) {
				throw new DomainException(
						"Missing the '" +
							NumberPrompt.XML_KEY_MIN +
							"' property: " +
							id);
			}
			min = Integer.decode(minVlp.getLabel());
		}
		catch(NumberFormatException e) {
			throw new DomainException(
					"The '" +
						NumberPrompt.XML_KEY_MIN +
						"' property is not an integer: " +
						id, 
					e);
		}
		
		int max;
		try {
			LabelValuePair maxVlp = 
				properties.get(NumberPrompt.XML_KEY_MAX);
			
			if(maxVlp == null) {
				throw new DomainException(
						"Missing the '" +
							NumberPrompt.XML_KEY_MAX +
							"' property: " +
							id);
			}
			max = Integer.decode(maxVlp.getLabel());
		}
		catch(NumberFormatException e) {
			throw new DomainException(
					"The '" +
						NumberPrompt.XML_KEY_MAX +
						"' property is not an integer: " +
						id, 
					e);
		}

		return new TextPrompt(
			id,
			condition,
			unit,
			text,
			explanationText,
			skippable,
			skipLabel,
			displayLabel,
			min,
			max,
			defaultValue,
			index);
	}
/**
	 * Processes a text prompt and returns a TextPrompt 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 TextPrompt object.
	 * 
	 * @throws DomainException Thrown if the required properties are missing or
	 * 						   if any of the parameters are invalid.
	 */
Processes a text prompt and returns a TextPrompt 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 TextPrompt object.

@throws DomainException Thrown if the required properties are missing or
if any of the parameters are invalid.
Processes a text prompt and returns a TextPrompt 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 TextPrompt object . @throws DomainException Thrown if the required properties are missing or if any of the parameters are invalid .
private static TextPrompt processText(
			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 {
		int min;
		try {
			LabelValuePair minVlp = 
				properties.get(NumberPrompt.XML_KEY_MIN);
			if(minVlp == null) {
				throw new DomainException(
						"Missing the '" +
							NumberPrompt.XML_KEY_MIN +
							"' property: " +
							id);
			}
			min = Integer.decode(minVlp.getLabel());
		}
		catch(NumberFormatException e) {
			throw new DomainException(
					"The '" +
						NumberPrompt.XML_KEY_MIN +
						"' property is not an integer: " +
						id, 
					e);
		}
		int max;
		try {
			LabelValuePair maxVlp = 
				properties.get(NumberPrompt.XML_KEY_MAX);
			if(maxVlp == null) {
				throw new DomainException(
						"Missing the '" +
							NumberPrompt.XML_KEY_MAX +
							"' property: " +
							id);
			}
			max = Integer.decode(maxVlp.getLabel());
		}
		catch(NumberFormatException e) {
			throw new DomainException(
					"The '" +
						NumberPrompt.XML_KEY_MAX +
						"' property is not an integer: " +
						id, 
					e);
		}
		return new TextPrompt(
			id,
			condition,
			unit,
			text,
			explanationText,
			skippable,
			skipLabel,
			displayLabel,
			min,
			max,
			defaultValue,
			index);
	}
private static TextPrompt processText ( 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 { int min ; try { LabelValuePair minVlp = properties . get ( NumberPrompt . XML_KEY_MIN ) ; if ( minVlp == null ) { throw new DomainException ( "Missing the '" + NumberPrompt . XML_KEY_MIN + "' property: " + id ) ; } min = Integer . decode ( minVlp . getLabel ( ) ) ; } catch ( NumberFormatException e ) { throw new DomainException ( "The '" + NumberPrompt . XML_KEY_MIN + "' property is not an integer: " + id , e ) ; } int max ; try { LabelValuePair maxVlp = properties . get ( NumberPrompt . XML_KEY_MAX ) ; if ( maxVlp == null ) { throw new DomainException ( "Missing the '" + NumberPrompt . XML_KEY_MAX + "' property: " + id ) ; } max = Integer . decode ( maxVlp . getLabel ( ) ) ; } catch ( NumberFormatException e ) { throw new DomainException ( "The '" + NumberPrompt . XML_KEY_MAX + "' property is not an integer: " + id , e ) ; } return new TextPrompt ( id , condition , unit , text , explanationText , skippable , skipLabel , displayLabel , min , max , defaultValue , index ) ; }
Processes a text prompt and returns a TextPrompt object.
Processes a text prompt and returns a TextPrompt object .