AnalysisOccurrencesParams.fromJson constructor
AnalysisOccurrencesParams.fromJson(})
Implementation
factory AnalysisOccurrencesParams.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json,
{ClientUriConverter? clientUriConverter}) {
json ??= {};
if (json is Map) {
String file;
if (json.containsKey('file')) {
file = clientUriConverter?.fromClientFilePath(
jsonDecoder.decodeString('$jsonPath.file', json['file'])) ??
jsonDecoder.decodeString('$jsonPath.file', json['file']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'file');
}
List<Occurrences> occurrences;
if (json.containsKey('occurrences')) {
occurrences = jsonDecoder.decodeList(
'$jsonPath.occurrences',
json['occurrences'],
(String jsonPath, Object? json) => Occurrences.fromJson(
jsonDecoder, jsonPath, json,
clientUriConverter: clientUriConverter));
} else {
throw jsonDecoder.mismatch(jsonPath, 'occurrences');
}
return AnalysisOccurrencesParams(file, occurrences);
} else {
throw jsonDecoder.mismatch(jsonPath, 'analysis.occurrences params', json);
}
}