private void fromJSONAllSizes(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 AllSizes of FoodJSON is not an array."); } int count1 = json_array1.componentCount(); List <FoodSizeJSON> vector_AllSizes1 = new List <FoodSizeJSON>(count1); for (int num1 = 0; num1 < count1; ++num1) { FoodSizeJSON convert_classy = FoodSizeJSON.from_json(json_array1.component(num1), ignore_extras, true); vector_AllSizes1.Add(convert_classy); } initAllSizes(); for (int num1 = 0; num1 < vector_AllSizes1.Count; ++num1) { appendAllSizes(vector_AllSizes1[num1]); } for (int num1 = 0; num1 < vector_AllSizes1.Count; ++num1) { } }
protected override void finish() { FoodSizeJSON result = new FoodSizeJSON(); Debug.Assert(result != null); finish(result); handle_result(result); }
public void appendAllSizes(FoodSizeJSON to_append) { if (!flagHasAllSizes) { flagHasAllSizes = true; storeAllSizes.Clear(); } Debug.Assert(flagHasAllSizes); storeAllSizes.Add(to_append); }
protected void finish(FoodSizeJSON result) { if (fieldGeneratorWrittenSing.have_value) { result.setWrittenSing(fieldGeneratorWrittenSing.value); fieldGeneratorWrittenSing.have_value = false; } else if ((!(result.hasWrittenSing())) && !allow_incomplete) { error("When parsing the object for %what%, the \"WrittenSing\" field was missing."); } if (fieldGeneratorWrittenPlur.have_value) { result.setWrittenPlur(fieldGeneratorWrittenPlur.value); fieldGeneratorWrittenPlur.have_value = false; } else if ((!(result.hasWrittenPlur())) && !allow_incomplete) { error("When parsing the object for %what%, the \"WrittenPlur\" field was missing."); } if (fieldGeneratorSpokenSizeAndFoodSing.have_value) { result.setSpokenSizeAndFoodSing(fieldGeneratorSpokenSizeAndFoodSing.value); fieldGeneratorSpokenSizeAndFoodSing.have_value = false; } else if ((!(result.hasSpokenSizeAndFoodSing())) && !allow_incomplete) { error("When parsing the object for %what%, the \"SpokenSizeAndFoodSing\" field was missing."); } if (fieldGeneratorSpokenSizeAndFoodPlur.have_value) { result.setSpokenSizeAndFoodPlur(fieldGeneratorSpokenSizeAndFoodPlur.value); fieldGeneratorSpokenSizeAndFoodPlur.have_value = false; } else if ((!(result.hasSpokenSizeAndFoodPlur())) && !allow_incomplete) { error("When parsing the object for %what%, the \"SpokenSizeAndFoodPlur\" field was missing."); } if (fieldGeneratorGrams.have_value) { result.setGramsText(fieldGeneratorGrams.value); fieldGeneratorGrams.have_value = false; } else if ((!(result.hasGrams())) && !allow_incomplete) { error("When parsing the object for %what%, the \"Grams\" field was missing."); } }
protected override void handle_result(FoodSizeJSON result) { top.value.Add(result); }
protected override void handle_result(FoodSizeJSON result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }
protected abstract void handle_result(FoodSizeJSON new_result);