Esempio n. 1
0
    private void  fromJSONEventInstances(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 EventInstances of SportsOlympicsEventSchedulesAndResultsInformationNuggetJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <SportsOlympicsEventSchedulesAndResultsInstanceJSON> vector_EventInstances1 = new List <SportsOlympicsEventSchedulesAndResultsInstanceJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            SportsOlympicsEventSchedulesAndResultsInstanceJSON convert_classy = SportsOlympicsEventSchedulesAndResultsInstanceJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_EventInstances1.Add(convert_classy);
        }
        initEventInstances();
        for (int num3 = 0; num3 < vector_EventInstances1.Count; ++num3)
        {
            appendEventInstances(vector_EventInstances1[num3]);
        }
        for (int num1 = 0; num1 < vector_EventInstances1.Count; ++num1)
        {
        }
    }
Esempio n. 2
0
 public void appendEventInstances(SportsOlympicsEventSchedulesAndResultsInstanceJSON to_append)
 {
     if (!flagHasEventInstances)
     {
         flagHasEventInstances = true;
         storeEventInstances.Clear();
     }
     Debug.Assert(flagHasEventInstances);
     storeEventInstances.Add(to_append);
 }
Esempio n. 3
0
        protected override void finish()
        {
            SportsOlympicsEventSchedulesAndResultsInstanceJSON result = new SportsOlympicsEventSchedulesAndResultsInstanceJSON();

            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.extraSportsOlympicsEventSchedulesAndResultsInstanceAppendPair(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);
        }
Esempio n. 4
0
 protected override void handle_result(SportsOlympicsEventSchedulesAndResultsInstanceJSON result)
 {
     top.value.Add(result);
 }
Esempio n. 5
0
        protected override void handle_result(SportsOlympicsEventSchedulesAndResultsInstanceJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Esempio n. 6
0
 protected abstract void handle_result(SportsOlympicsEventSchedulesAndResultsInstanceJSON new_result);
Esempio n. 7
0
 protected void finish(SportsOlympicsEventSchedulesAndResultsInstanceJSON result)
 {
     if (fieldGeneratorEvent.have_value)
     {
         result.setEvent(fieldGeneratorEvent.value);
         fieldGeneratorEvent.have_value = false;
     }
     else if ((!(result.hasEvent())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Event\" field was missing.");
     }
     if (fieldGeneratorEventCategory.have_value)
     {
         result.setEventCategory(fieldGeneratorEventCategory.value);
         fieldGeneratorEventCategory.have_value = false;
     }
     else if ((!(result.hasEventCategory())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"EventCategory\" field was missing.");
     }
     if (fieldGeneratorInstanceDescription.have_value)
     {
         result.setInstanceDescription(fieldGeneratorInstanceDescription.value);
         fieldGeneratorInstanceDescription.have_value = false;
     }
     if (fieldGeneratorGames.have_value)
     {
         result.setGames(fieldGeneratorGames.value);
         fieldGeneratorGames.have_value = false;
     }
     else if ((!(result.hasGames())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Games\" field was missing.");
     }
     if (fieldGeneratorMedalEvent.have_value)
     {
         result.setMedalEvent(fieldGeneratorMedalEvent.value);
         fieldGeneratorMedalEvent.have_value = false;
     }
     if (fieldGeneratorGeneralSummary.have_value)
     {
         result.setGeneralSummary(fieldGeneratorGeneralSummary.value);
         fieldGeneratorGeneralSummary.have_value = false;
     }
     if (fieldGeneratorStartTime.have_value)
     {
         result.setStartTime(fieldGeneratorStartTime.value);
         fieldGeneratorStartTime.have_value = false;
     }
     if (fieldGeneratorMedalWinners.have_value)
     {
         result.initMedalWinners();
         int count = fieldGeneratorMedalWinners.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendMedalWinners(fieldGeneratorMedalWinners.value[num]);
         }
         fieldGeneratorMedalWinners.value.Clear();
         fieldGeneratorMedalWinners.have_value = false;
     }
     if (fieldGeneratorParticipants.have_value)
     {
         result.initParticipants();
         int count = fieldGeneratorParticipants.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendParticipants(fieldGeneratorParticipants.value[num]);
         }
         fieldGeneratorParticipants.value.Clear();
         fieldGeneratorParticipants.have_value = false;
     }
     if (fieldGeneratorUpcoming.have_value)
     {
         result.setUpcoming(fieldGeneratorUpcoming.value);
         fieldGeneratorUpcoming.have_value = false;
     }
 }