Exemple #1
0
    private void  fromJSONPhoneNumbers(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 PhoneNumbers of PhoneNumberDisambiguationCandidateJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <TypePhoneNumbersJSON> vector_PhoneNumbers1 = new List <TypePhoneNumbersJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            TypePhoneNumbersJSON convert_classy = TypePhoneNumbersJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_PhoneNumbers1.Add(convert_classy);
        }
        initPhoneNumbers();
        for (int num1 = 0; num1 < vector_PhoneNumbers1.Count; ++num1)
        {
            appendPhoneNumbers(vector_PhoneNumbers1[num1]);
        }
        for (int num1 = 0; num1 < vector_PhoneNumbers1.Count; ++num1)
        {
        }
    }
Exemple #2
0
            protected override void finish()
            {
                TypePhoneNumbersJSON result = new TypePhoneNumbersJSON();

                Debug.Assert(result != null);
                finish(result);
                handle_result(result);
            }
Exemple #3
0
 public void appendPhoneNumbers(TypePhoneNumbersJSON to_append)
 {
     if (!flagHasPhoneNumbers)
     {
         flagHasPhoneNumbers = true;
         storePhoneNumbers.Clear();
     }
     Debug.Assert(flagHasPhoneNumbers);
     storePhoneNumbers.Add(to_append);
 }
Exemple #4
0
 protected void finish(TypePhoneNumbersJSON result)
 {
     if (fieldGeneratorLabel.have_value)
     {
         result.setLabel(fieldGeneratorLabel.value);
         fieldGeneratorLabel.have_value = false;
     }
     else if ((!(result.hasLabel())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Label\" field was missing.");
     }
     if (fieldGeneratorNumber.have_value)
     {
         result.setNumber(fieldGeneratorNumber.value);
         fieldGeneratorNumber.have_value = false;
     }
     else if ((!(result.hasNumber())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Number\" field was missing.");
     }
 }
Exemple #5
0
 protected override void handle_result(TypePhoneNumbersJSON result)
 {
     top.value.Add(result);
 }
Exemple #6
0
 protected override void handle_result(TypePhoneNumbersJSON result)
 {
     //@@@            Debug.Assert(!have_value);
     have_value = true;
     value      = result;
 }
Exemple #7
0
 protected abstract void handle_result(TypePhoneNumbersJSON new_result);