FullFormParser

public class FullFormParser

Class for converting the XML passed in as a constructor parameter to an instance of the FormValueElement class.

Fields

DEVICE_LOG

public static final String DEVICE_LOG

DEVICE_REPORT_ELEMENT

public static final String DEVICE_REPORT_ELEMENT

FORM

public static final String FORM

FORM_DATA_ELEMENT

public static final String FORM_DATA_ELEMENT

XMLNS_ELEMENT

public static final String XMLNS_ELEMENT

Constructors

FullFormParser

public FullFormParser(String xmlDoc)

Creates an instance of the FullFormParser which will provide a method for parsing the given xmlDoc.

Parameters:
  • xmlDoc – the XML document

Methods

parse

public FormValueElement parse()

Method to parse incoming “full” XML forms from CommCareHQ. Parser assumes the form has an element with the tag “data”. If the form does not, and instead has a device report, a null form is returned. Otherwise an exception is thrown indicating an unknown or faulty form XML.

Throws:
Returns:

the parsed form, null if a device report