private void fromJSONQueryBlocks(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 QueryBlocks of StockMarketInformationNuggetJSON is not an array."); } int count1 = json_array1.componentCount(); List <StockQueryBlockJSON> vector_QueryBlocks1 = new List <StockQueryBlockJSON>(count1); for (int num1 = 0; num1 < count1; ++num1) { StockQueryBlockJSON convert_classy = StockQueryBlockJSON.from_json(json_array1.component(num1), ignore_extras, true); vector_QueryBlocks1.Add(convert_classy); } initQueryBlocks(); for (int num1 = 0; num1 < vector_QueryBlocks1.Count; ++num1) { appendQueryBlocks(vector_QueryBlocks1[num1]); } for (int num1 = 0; num1 < vector_QueryBlocks1.Count; ++num1) { } }
public void appendQueryBlocks(StockQueryBlockJSON to_append) { if (!flagHasQueryBlocks) { flagHasQueryBlocks = true; storeQueryBlocks.Clear(); } Debug.Assert(flagHasQueryBlocks); storeQueryBlocks.Add(to_append); }
protected override void finish() { StockQueryBlockJSON result = new StockQueryBlockJSON(); 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.extraStockQueryBlockAppendPair(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(StockQueryBlockJSON result) { top.value.Add(result); }
protected override void handle_result(StockQueryBlockJSON result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }
protected abstract void handle_result(StockQueryBlockJSON new_result);
protected void finish(StockQueryBlockJSON result) { if (fieldGeneratorOldConversation.have_value) { result.setOldConversation(fieldGeneratorOldConversation.value); fieldGeneratorOldConversation.have_value = false; } else if ((!(result.hasOldConversation())) && !allow_incomplete) { error("When parsing the object for %what%, the \"OldConversation\" field was missing."); } if (fieldGeneratorRequestedAttributes.have_value) { result.initRequestedAttributes(); int count = fieldGeneratorRequestedAttributes.value.Count; for (int num = 0; num < count; ++num) { result.appendRequestedAttributes(fieldGeneratorRequestedAttributes.value[num]); } fieldGeneratorRequestedAttributes.value.Clear(); fieldGeneratorRequestedAttributes.have_value = false; } else if ((!(result.hasRequestedAttributes())) && !allow_incomplete) { error("When parsing the object for %what%, the \"RequestedAttributes\" field was missing."); } if (fieldGeneratorRequestedListings.have_value) { result.initRequestedListings(); int count = fieldGeneratorRequestedListings.value.Count; for (int num = 0; num < count; ++num) { result.appendRequestedListings(fieldGeneratorRequestedListings.value[num]); } fieldGeneratorRequestedListings.value.Clear(); fieldGeneratorRequestedListings.have_value = false; } else if ((!(result.hasRequestedListings())) && !allow_incomplete) { error("When parsing the object for %what%, the \"RequestedListings\" field was missing."); } if (fieldGeneratorInvalidListings.have_value) { result.initInvalidListings(); int count = fieldGeneratorInvalidListings.value.Count; for (int num = 0; num < count; ++num) { result.appendInvalidListings(fieldGeneratorInvalidListings.value[num]); } fieldGeneratorInvalidListings.value.Clear(); fieldGeneratorInvalidListings.have_value = false; } else if ((!(result.hasInvalidListings())) && !allow_incomplete) { error("When parsing the object for %what%, the \"InvalidListings\" field was missing."); } if (fieldGeneratorGeneralMarketQuery.have_value) { result.setGeneralMarketQuery(fieldGeneratorGeneralMarketQuery.value); fieldGeneratorGeneralMarketQuery.have_value = false; } }