Exemple #1
0
    private void  fromJSONTrackList(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        MusicTrackResultJSON convert_classy = MusicTrackResultJSON.from_json(json_value, ignore_extras, true);

        setTrackList(convert_classy);
    }
    private void  fromJSONTrackResults(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 TrackResults of MusicSearchResultsJSON is not an array.");
        }
        int count1 = json_array1.componentCount();

        if (count1 < 1)
        {
            throw new Exception("The value for field TrackResults of MusicSearchResultsJSON has too few elements.");
        }
        List <MusicTrackResultJSON> vector_TrackResults1 = new List <MusicTrackResultJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            MusicTrackResultJSON convert_classy = MusicTrackResultJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_TrackResults1.Add(convert_classy);
        }
        Debug.Assert(vector_TrackResults1.Count >= 1);
        initTrackResults();
        for (int num1 = 0; num1 < vector_TrackResults1.Count; ++num1)
        {
            appendTrackResults(vector_TrackResults1[num1]);
        }
        for (int num1 = 0; num1 < vector_TrackResults1.Count; ++num1)
        {
        }
    }
 protected void finish(MusicTrackResultJSON result)
 {
     if (fieldGeneratorTrackName.have_value)
     {
         result.setTrackName(fieldGeneratorTrackName.value);
         fieldGeneratorTrackName.have_value = false;
     }
     else if ((!(result.hasTrackName())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"TrackName\" 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 (fieldGeneratorAlbumName.have_value)
     {
         result.setAlbumName(fieldGeneratorAlbumName.value);
         fieldGeneratorAlbumName.have_value = false;
     }
     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.");
     }
 }
Exemple #4
0
 public void setTrackList(MusicTrackResultJSON new_value)
 {
     if (flagHasTrackList)
     {
     }
     flagHasTrackList = true;
     storeTrackList   = new_value;
 }
        protected override void finish()
        {
            MusicTrackResultJSON result = new MusicTrackResultJSON();

            Debug.Assert(result != null);
            finish(result);
            handle_result(result);
        }
 public void appendTrackResults(MusicTrackResultJSON to_append)
 {
     if (!flagHasTrackResults)
     {
         flagHasTrackResults = true;
         storeTrackResults.Clear();
     }
     Debug.Assert(flagHasTrackResults);
     storeTrackResults.Add(to_append);
 }
 protected override void handle_result(MusicTrackResultJSON result)
 {
     top.value.Add(result);
 }
        protected override void handle_result(MusicTrackResultJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
 protected abstract void handle_result(MusicTrackResultJSON new_result);