Example #1
0
    private void  fromJSONDisambiguationCandidates(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 DisambiguationCandidates of DisambiguateEmailJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <EmailDisambiguationCandidateJSON> vector_DisambiguationCandidates1 = new List <EmailDisambiguationCandidateJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            EmailDisambiguationCandidateJSON convert_classy = EmailDisambiguationCandidateJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_DisambiguationCandidates1.Add(convert_classy);
        }
        initDisambiguationCandidates();
        for (int num1 = 0; num1 < vector_DisambiguationCandidates1.Count; ++num1)
        {
            appendDisambiguationCandidates(vector_DisambiguationCandidates1[num1]);
        }
        for (int num1 = 0; num1 < vector_DisambiguationCandidates1.Count; ++num1)
        {
        }
    }
        protected override void finish()
        {
            EmailDisambiguationCandidateJSON result = new EmailDisambiguationCandidateJSON();

            Debug.Assert(result != null);
            finish(result);
            handle_result(result);
        }
Example #3
0
 public void appendDisambiguationCandidates(EmailDisambiguationCandidateJSON to_append)
 {
     if (!flagHasDisambiguationCandidates)
     {
         flagHasDisambiguationCandidates = true;
         storeDisambiguationCandidates.Clear();
     }
     Debug.Assert(flagHasDisambiguationCandidates);
     storeDisambiguationCandidates.Add(to_append);
 }
 protected void finish(EmailDisambiguationCandidateJSON result)
 {
     if (fieldGeneratorContactName.have_value)
     {
         result.setContactName(fieldGeneratorContactName.value);
         fieldGeneratorContactName.have_value = false;
     }
     else if ((!(result.hasContactName())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"ContactName\" field was missing.");
     }
     if (fieldGeneratorContactID.have_value)
     {
         result.setContactID(fieldGeneratorContactID.value);
         fieldGeneratorContactID.have_value = false;
     }
     else if ((!(result.hasContactID())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"ContactID\" field was missing.");
     }
     if (fieldGeneratorEmails.have_value)
     {
         result.initEmails();
         int count = fieldGeneratorEmails.value.Count;
         for (int num = 0; num < count; ++num)
         {
             result.appendEmails(fieldGeneratorEmails.value[num]);
         }
         fieldGeneratorEmails.value.Clear();
         fieldGeneratorEmails.have_value = false;
     }
     else if ((!(result.hasEmails())) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"Emails\" field was missing.");
     }
 }
 protected override void handle_result(EmailDisambiguationCandidateJSON result)
 {
     top.value.Add(result);
 }
        protected override void handle_result(EmailDisambiguationCandidateJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
 protected abstract void handle_result(EmailDisambiguationCandidateJSON new_result);