FormAdapter¶
-
public final class
FormAdapter¶ Class responsible for deserializing forms from JSON.
Methods¶
isAttribute¶
isValue¶
readJson¶
-
public static CommcareForm
readJson(String json)¶ Deserializes the given JSON string into an instance of the
CommcareFormclass.Parameters: - json – the JSON representation of the form
Returns: the deserialized form
readListJson¶
-
public static CommcareFormList
readListJson(String json)¶ Reads a list o forms with metadata from the json file. The result is represented as a
CommcareFormListobject.Parameters: - json – the json to read
Returns: the parsed value
recursivelyParse¶
-
public static FormValueElement
recursivelyParse(String key, JsonElement jsonElement)¶ Parses the given
jsonElementinto an instance of theFormValueElementclass. The created object will have its name set to thekey.Parameters: - key – the name of the element to set
- jsonElement – the JSON element
Returns: the parsed object