Interface JSONEncoder
access this type via: data.json.JSONEncoder (provides, requires or uses)
JSON encoder: converts JSON document into Dana data types and vice-versa.
Functions
Data[] jsonToArray(char json[], Type t, Map map[])
Data jsonToData(char json[], Type t, Map map[])
char[] jsonFromArray(Data d[], Map map[])
char[] jsonFromData(Data d, Map map[])
Data[] jsonToArray(char json[], Type t, Map map[])
json JSON document provided as input.
t Data type to which the JSON document will be converted to.
map In some cases the key name in a JSON document does not match the name of a variable of a Dana data type. In those cases, it is necessary to provide a dictionary mapping the key name to the name of the variable in the Dana data type. The most common case is when JSON documents use as key names Dana reserved words. An example of a map looks like the following: Map map = new Map[](new Map(''data'', ''data_'')). When a key is named 'data', but 'data' is a reserved word in Dana.
Data jsonToData(char json[], Type t, Map map[])
json JSON document provided as input.
t Data type to which the JSON document will be converted to.
map In some cases the key name in a JSON document does not match the name of a variable of a Dana data type. In those cases, it is necessary to provide a dictionary mapping the key name to the name of the variable in the Dana data type. The most common case is when JSON documents use as key names Dana reserved words. An example of a map looks like the following: Map map = new Map[](new Map(''data'', ''data_'')). When a key is named 'data', but 'data' is a reserved word in Dana.
char[] jsonFromArray(Data d[], Map map[])
d Dana data array that will be converted into a JSON.
map In some cases the key name in a JSON document does not match the name of a variable of a Dana data type. In those cases, it is necessary to provide a dictionary mapping the key name to the name of the variable in the Dana data type. The most common case is when JSON documents use as key names Dana reserved words. An example of a map looks like the following: Map map = new Map[](new Map(''data'', ''data_'')). When a key is named 'data', but 'data' is a reserved word in Dana.
char[] jsonFromData(Data d, Map map[])
d Dana data that will be converted into a JSON.
map In some cases the key name in a JSON document does not match the name of a variable of a Dana data type. In those cases, it is necessary to provide a dictionary mapping the key name to the name of the variable in the Dana data type. The most common case is when JSON documents use as key names Dana reserved words. An example of a map looks like the following: Map map = new Map[](new Map(''data'', ''data_'')). When a key is named 'data', but 'data' is a reserved word in Dana.