protected void finish(FlightBookingInformationNuggetJSON result)
 {
     if (fieldGeneratorFlightBookingSearchSpec.have_value)
     {
         result.setFlightBookingSearchSpec(fieldGeneratorFlightBookingSearchSpec.value);
         fieldGeneratorFlightBookingSearchSpec.have_value = false;
     }
     else if ((!(result.hasFlightBookingSearchSpec())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"FlightBookingSearchSpec\" field was missing.");
     }
     if (fieldGeneratorCurrentDateAndTime.have_value)
     {
         result.setCurrentDateAndTime(fieldGeneratorCurrentDateAndTime.value);
         fieldGeneratorCurrentDateAndTime.have_value = false;
     }
     else if ((!(result.hasCurrentDateAndTime())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"CurrentDateAndTime\" field was missing.");
     }
     if (fieldGeneratorFlightProducts.have_value)
     {
         result.initFlightProducts();
         int count = fieldGeneratorFlightProducts.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendFlightProducts(fieldGeneratorFlightProducts.value[num]);
         }
         fieldGeneratorFlightProducts.value.Clear();
         fieldGeneratorFlightProducts.have_value = false;
     }
     if (fieldGeneratorFlightSegments.have_value)
     {
         result.initFlightSegments();
         int count = fieldGeneratorFlightSegments.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendFlightSegments(fieldGeneratorFlightSegments.value[num]);
         }
         fieldGeneratorFlightSegments.value.Clear();
         fieldGeneratorFlightSegments.have_value = false;
     }
     base.finish(result);
 }
        protected override void finish()
        {
            if (!(getInformationNuggetJSONKey().Equals("FlightBooking")))
            {
                throw new Exception("The key field has a value other than `FlightBooking'.");
            }
            FlightBookingInformationNuggetJSON result = new FlightBookingInformationNuggetJSON();

            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.extraFlightBookingInformationNuggetAppendPair(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);
        }
 protected abstract void handle_result(FlightBookingInformationNuggetJSON new_result);
 protected override void handle_result(FlightBookingInformationNuggetJSON result)
 {
     top.value.Add(result);
 }
        protected override void handle_result(FlightBookingInformationNuggetJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }