示例#1
0
    private void  fromJSONStandings(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 Standings of SportsOlympicsMedalStandingsJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <SportsOlympicsMedalStandingsOrganizationMedalCountJSON> vector_Standings1 = new List <SportsOlympicsMedalStandingsOrganizationMedalCountJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            SportsOlympicsMedalStandingsOrganizationMedalCountJSON convert_classy = SportsOlympicsMedalStandingsOrganizationMedalCountJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_Standings1.Add(convert_classy);
        }
        initStandings();
        for (int num1 = 0; num1 < vector_Standings1.Count; ++num1)
        {
            appendStandings(vector_Standings1[num1]);
        }
        for (int num1 = 0; num1 < vector_Standings1.Count; ++num1)
        {
        }
    }
示例#2
0
 protected void finish(SportsOlympicsMedalStandingsOrganizationMedalCountJSON result)
 {
     if (fieldGeneratorOrganization.have_value)
     {
         result.setOrganization(fieldGeneratorOrganization.value);
         fieldGeneratorOrganization.have_value = false;
     }
     else if ((!(result.hasOrganization())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Organization\" field was missing.");
     }
     if (fieldGeneratorGoldMedals.have_value)
     {
         result.setGoldMedals(fieldGeneratorGoldMedals.value);
         fieldGeneratorGoldMedals.have_value = false;
     }
     else if ((!(result.hasGoldMedals())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"GoldMedals\" field was missing.");
     }
     if (fieldGeneratorSilverMedals.have_value)
     {
         result.setSilverMedals(fieldGeneratorSilverMedals.value);
         fieldGeneratorSilverMedals.have_value = false;
     }
     else if ((!(result.hasSilverMedals())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"SilverMedals\" field was missing.");
     }
     if (fieldGeneratorBronzeMedals.have_value)
     {
         result.setBronzeMedals(fieldGeneratorBronzeMedals.value);
         fieldGeneratorBronzeMedals.have_value = false;
     }
     else if ((!(result.hasBronzeMedals())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"BronzeMedals\" field was missing.");
     }
     if (fieldGeneratorTotalMedals.have_value)
     {
         result.setTotalMedals(fieldGeneratorTotalMedals.value);
         fieldGeneratorTotalMedals.have_value = false;
     }
     else if ((!(result.hasTotalMedals())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"TotalMedals\" field was missing.");
     }
     if (fieldGeneratorRank.have_value)
     {
         result.setRank(fieldGeneratorRank.value);
         fieldGeneratorRank.have_value = false;
     }
     if (fieldGeneratorRankIsTied.have_value)
     {
         result.setRankIsTied(fieldGeneratorRankIsTied.value);
         fieldGeneratorRankIsTied.have_value = false;
     }
 }
示例#3
0
 public void appendStandings(SportsOlympicsMedalStandingsOrganizationMedalCountJSON to_append)
 {
     if (!flagHasStandings)
     {
         flagHasStandings = true;
         storeStandings.Clear();
     }
     Debug.Assert(flagHasStandings);
     storeStandings.Add(to_append);
 }
示例#4
0
        protected override void finish()
        {
            SportsOlympicsMedalStandingsOrganizationMedalCountJSON result = new SportsOlympicsMedalStandingsOrganizationMedalCountJSON();

            Debug.Assert(result != null);
            finish(result);
            int extra_count = unknownFieldGenerator.field_names.Count;

            Debug.Assert(extra_count == unknownFieldGenerator.field_values.Count);
            for (int extra_num = 0; extra_num < extra_count; ++extra_num)
            {
                result.extraSportsOlympicsMedalStandingsOrganizationMedalCountAppendPair(unknownFieldGenerator.field_names[extra_num], unknownFieldGenerator.field_values[extra_num]);
            }
            unknownFieldGenerator.field_names.Clear();
            unknownFieldGenerator.field_values.Clear();
            unknownFieldGenerator.index = new Dictionary <string, JSONValue>();
            handle_result(result);
        }
示例#5
0
        protected override void handle_result(SportsOlympicsMedalStandingsOrganizationMedalCountJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
示例#6
0
 protected abstract void handle_result(SportsOlympicsMedalStandingsOrganizationMedalCountJSON new_result);
示例#7
0
 protected override void handle_result(SportsOlympicsMedalStandingsOrganizationMedalCountJSON result)
 {
     top.value.Add(result);
 }