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
CommcareForm
class.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
CommcareFormList
object.Parameters: - json – the json to read
Returns: the parsed value
recursivelyParse¶
-
public static FormValueElement
recursivelyParse
(String key, JsonElement jsonElement)¶ Parses the given
jsonElement
into an instance of theFormValueElement
class. 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