Beispiel #1
0
    private void  fromJSONUberEstimatesSpec(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        UberEstimatesSpecJSON convert_classy = UberEstimatesSpecJSON.from_json(json_value, ignore_extras, true);

        setUberEstimatesSpec(convert_classy);
    }
Beispiel #2
0
 public void setUberEstimatesSpec(UberEstimatesSpecJSON new_value)
 {
     if (flagHasUberEstimatesSpec)
     {
     }
     flagHasUberEstimatesSpec = true;
     storeUberEstimatesSpec   = new_value;
 }
Beispiel #3
0
 protected void finish(UberEstimatesSpecJSON result)
 {
     if (fieldGeneratorPreferredProduct.have_value)
     {
         result.setPreferredProduct(fieldGeneratorPreferredProduct.value);
         fieldGeneratorPreferredProduct.have_value = false;
     }
     else if ((!(result.hasPreferredProduct())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"PreferredProduct\" field was missing.");
     }
     if (fieldGeneratorPickupLocation.have_value)
     {
         result.setPickupLocation(fieldGeneratorPickupLocation.value);
         fieldGeneratorPickupLocation.have_value = false;
     }
     else if ((!(result.hasPickupLocation())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"PickupLocation\" field was missing.");
     }
     if (fieldGeneratorDropoffLocation.have_value)
     {
         result.setDropoffLocation(fieldGeneratorDropoffLocation.value);
         fieldGeneratorDropoffLocation.have_value = false;
     }
     if (fieldGeneratorPassengerCount.have_value)
     {
         result.setPassengerCount(fieldGeneratorPassengerCount.value);
         fieldGeneratorPassengerCount.have_value = false;
     }
     else if ((!(result.hasPassengerCount())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"PassengerCount\" field was missing.");
     }
     if (fieldGeneratorEstimateTypes.have_value)
     {
         result.initEstimateTypes();
         int count = fieldGeneratorEstimateTypes.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendEstimateTypes(fieldGeneratorEstimateTypes.value[num]);
         }
         fieldGeneratorEstimateTypes.value.Clear();
         fieldGeneratorEstimateTypes.have_value = false;
     }
     else if ((!(result.hasEstimateTypes())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"EstimateTypes\" field was missing.");
     }
     base.finish(result);
 }
Beispiel #4
0
        protected override void finish()
        {
            if (!(getUberSpecJSONKey().Equals("UberEstimatesSpec")))
            {
                throw new Exception("The key field has a value other than `UberEstimatesSpec'.");
            }
            UberEstimatesSpecJSON result = new UberEstimatesSpecJSON();

            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.extraUberEstimatesSpecAppendPair(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);
        }
Beispiel #5
0
 protected override void handle_result(UberEstimatesSpecJSON result)
 {
     top.value.Add(result);
 }
Beispiel #6
0
        protected override void handle_result(UberEstimatesSpecJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
Beispiel #7
0
 protected abstract void handle_result(UberEstimatesSpecJSON new_result);