private void fromJSONCommand(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 Command of ContactMungerInputJSON is not an array."); } int count1 = json_array1.componentCount(); if (count1 < 1) { throw new Exception("The value for field Command of ContactMungerInputJSON has too few elements."); } List <TypeCommandJSON> vector_Command1 = new List <TypeCommandJSON>(count1); for (int num1 = 0; num1 < count1; ++num1) { TypeCommandJSON convert_classy = TypeCommandJSON.from_json(json_array1.component(num1), ignore_extras, true); vector_Command1.Add(convert_classy); } Debug.Assert(vector_Command1.Count >= 1); initCommand(); for (int num1 = 0; num1 < vector_Command1.Count; ++num1) { appendCommand(vector_Command1[num1]); } for (int num1 = 0; num1 < vector_Command1.Count; ++num1) { } }
protected void finish(TypeCommandJSON result) { if (fieldGeneratorPath.have_value) { result.setPath(fieldGeneratorPath.value); fieldGeneratorPath.have_value = false; } else if ((!(result.hasPath())) && !allow_incomplete) { error("When parsing the object for %what%, the \"Path\" field was missing."); } if (fieldGeneratorAction.have_value) { result.setAction(fieldGeneratorAction.value); fieldGeneratorAction.have_value = false; } else if ((!(result.hasAction())) && !allow_incomplete) { error("When parsing the object for %what%, the \"Action\" field was missing."); } if (fieldGeneratorData.have_value) { result.setData(fieldGeneratorData.value); fieldGeneratorData.have_value = false; } else if ((!(result.hasData())) && !allow_incomplete) { error("When parsing the object for %what%, the \"Data\" field was missing."); } }
public void appendCommand(TypeCommandJSON to_append) { if (!flagHasCommand) { flagHasCommand = true; storeCommand.Clear(); } Debug.Assert(flagHasCommand); storeCommand.Add(to_append); }
protected override void finish() { TypeCommandJSON result = new TypeCommandJSON(); 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.extraTypeCommandAppendPair(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 override void handle_result(TypeCommandJSON result) { top.value.Add(result); }
protected override void handle_result(TypeCommandJSON result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }
protected abstract void handle_result(TypeCommandJSON new_result);