private void  fromJSONArtists(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 Artists of MusicAlbumJSON is not an array.");
        }
        int count1 = json_array1.componentCount();

        if (count1 < 1)
        {
            throw new Exception("The value for field Artists of MusicAlbumJSON has too few elements.");
        }
        List <MusicArtistBaseJSON> vector_Artists1 = new List <MusicArtistBaseJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            MusicArtistBaseJSON convert_classy = MusicArtistBaseJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_Artists1.Add(convert_classy);
        }
        Debug.Assert(vector_Artists1.Count >= 1);
        initArtists();
        for (int num1 = 0; num1 < vector_Artists1.Count; ++num1)
        {
            appendArtists(vector_Artists1[num1]);
        }
        for (int num1 = 0; num1 < vector_Artists1.Count; ++num1)
        {
        }
    }
예제 #2
0
    private void  fromJSONArtist(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        MusicArtistBaseJSON convert_classy = MusicArtistBaseJSON.from_json(json_value, ignore_extras, true);

        setArtist(convert_classy);
    }
예제 #3
0
 public void setArtist(MusicArtistBaseJSON new_value)
 {
     if (flagHasArtist)
     {
     }
     flagHasArtist = true;
     storeArtist   = new_value;
 }
 public void appendArtists(MusicArtistBaseJSON to_append)
 {
     if (!flagHasArtists)
     {
         flagHasArtists = true;
         storeArtists.Clear();
     }
     Debug.Assert(flagHasArtists);
     storeArtists.Add(to_append);
 }
    public static MusicArtistJSON from_MusicArtistBaseJSON_json(MusicArtistBaseJSON ancestor, bool ignore_extras)
    {
        Debug.Assert(ancestor != null);
        MusicArtistJSON result;

        {
            HoldingGenerator handler = new HoldingGenerator("Type MusicArtist", ignore_extras);
            ancestor.write_as_json(handler);
            result = handler.value;
        }
        return(result);
    }
 protected override void handle_result(MusicArtistBaseJSON new_result)
 {
     handle_result((MusicArtistJSON )new_result);
 }