private void fromJSONAlbumResults(JSONValue json_value, bool ignore_extras) { Debug.Assert(json_value != null); JSONArrayValue json_array1 = json_value.array_value(); if (json_array1 == null) { throw new Exception("The value for field AlbumResults of MusicSearchResultsJSON is not an array."); } int count1 = json_array1.componentCount(); if (count1 < 1) { throw new Exception("The value for field AlbumResults of MusicSearchResultsJSON has too few elements."); } List <MusicAlbumResultJSON> vector_AlbumResults1 = new List <MusicAlbumResultJSON>(count1); for (int num1 = 0; num1 < count1; ++num1) { MusicAlbumResultJSON convert_classy = MusicAlbumResultJSON.from_json(json_array1.component(num1), ignore_extras, true); vector_AlbumResults1.Add(convert_classy); } Debug.Assert(vector_AlbumResults1.Count >= 1); initAlbumResults(); for (int num3 = 0; num3 < vector_AlbumResults1.Count; ++num3) { appendAlbumResults(vector_AlbumResults1[num3]); } for (int num1 = 0; num1 < vector_AlbumResults1.Count; ++num1) { } }
protected void finish(MusicAlbumResultJSON result) { if (fieldGeneratorAlbumName.have_value) { result.setAlbumName(fieldGeneratorAlbumName.value); fieldGeneratorAlbumName.have_value = false; } else if ((!(result.hasAlbumName())) && !allow_incomplete) { error("When parsing the object for %what%, the \"AlbumName\" field was missing."); } if (fieldGeneratorArtistName.have_value) { result.setArtistName(fieldGeneratorArtistName.value); fieldGeneratorArtistName.have_value = false; } else if ((!(result.hasArtistName())) && !allow_incomplete) { error("When parsing the object for %what%, the \"ArtistName\" field was missing."); } if (fieldGeneratorSoundHoundId.have_value) { result.setSoundHoundId(fieldGeneratorSoundHoundId.value); fieldGeneratorSoundHoundId.have_value = false; } else if ((!(result.hasSoundHoundId())) && !allow_incomplete) { error("When parsing the object for %what%, the \"SoundHoundId\" field was missing."); } }
protected override void finish() { MusicAlbumResultJSON result = new MusicAlbumResultJSON(); Debug.Assert(result != null); finish(result); handle_result(result); }
public void appendAlbumResults(MusicAlbumResultJSON to_append) { if (!flagHasAlbumResults) { flagHasAlbumResults = true; storeAlbumResults.Clear(); } Debug.Assert(flagHasAlbumResults); storeAlbumResults.Add(to_append); }
protected override void handle_result(MusicAlbumResultJSON result) { top.value.Add(result); }
protected override void handle_result(MusicAlbumResultJSON result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }
protected abstract void handle_result(MusicAlbumResultJSON new_result);