protected void finish(GeneralizedThingJSON result)
 {
     if (fieldGeneratorSpokenLabel.have_value)
     {
         result.setSpokenLabel(fieldGeneratorSpokenLabel.value);
         fieldGeneratorSpokenLabel.have_value = false;
     }
     else if ((!(result.hasSpokenLabel())) && (!allow_unpolished) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"SpokenLabel\" field was missing.");
     }
     if (fieldGeneratorWrittenLabel.have_value)
     {
         result.setWrittenLabel(fieldGeneratorWrittenLabel.value);
         fieldGeneratorWrittenLabel.have_value = false;
     }
     else if ((!(result.hasWrittenLabel())) && (!allow_unpolished) && !allow_incomplete)
     {
         error("When parsing the object for %what%, the \"WrittenLabel\" field was missing.");
     }
     if (fieldGeneratorSpokenLabelSSML.have_value)
     {
         result.setSpokenLabelSSML(fieldGeneratorSpokenLabelSSML.value);
         fieldGeneratorSpokenLabelSSML.have_value = false;
     }
 }
예제 #2
0
    private void  fromJSONBase(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        GeneralizedThingJSON convert_classy = GeneralizedThingJSON.from_json(json_value, ignore_extras, true);

        setBase(convert_classy);
    }
        protected override void finish()
        {
            if (!(keyGenerator.have_value))
            {
                throw new Exception("The `ThingKind' field is missing.");
            }
            GeneralizedThingJSON result = createForKey(keyGenerator.value, unknownFieldGenerator.index);

            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.extraGeneralizedThingAppendPair(unknownFieldGenerator.field_names[extra_num], unknownFieldGenerator.field_values[extra_num]);
            }
            unknownFieldGenerator.field_names.Clear();
            unknownFieldGenerator.field_values.Clear();
            unknownFieldGenerator.index = new Dictionary <string, JSONValue>();
            if (!allow_incomplete)
            {
                string missing_field_error = result.missing_field_error(allow_unpolished);
                if (missing_field_error != null)
                {
                    error(missing_field_error);
                }
            }
            handle_result(result);
        }
예제 #4
0
 public void setBase(GeneralizedThingJSON new_value)
 {
     if (flagHasBase)
     {
     }
     flagHasBase = true;
     storeBase   = new_value;
 }
예제 #5
0
 public void setGeneralizedThing(GeneralizedThingJSON new_value)
 {
     if (flagHasGeneralizedThing)
     {
     }
     flagHasGeneralizedThing = true;
     storeGeneralizedThing   = new_value;
 }
예제 #6
0
 protected override void handle_result(GeneralizedThingJSON new_result)
 {
     handle_result((UnknownGeneralizedThingJSON )new_result);
 }
 protected override void handle_result(GeneralizedThingJSON new_result)
 {
     handle_result((EmergencyServiceJSON )new_result);
 }
 protected override void handle_result(GeneralizedThingJSON new_result)
 {
     handle_result((HotlineServiceJSON )new_result);
 }
예제 #9
0
 protected override void handle_result(GeneralizedThingJSON new_result)
 {
     handle_result((AmountPropertyJSON )new_result);
 }
예제 #10
0
 protected override void handle_result(GeneralizedThingJSON new_result)
 {
     handle_result((SolarSystemBodyJSON )new_result);
 }
 protected override void handle_result(GeneralizedThingJSON result)
 {
     top.value.Add(result);
 }
        protected override void handle_result(GeneralizedThingJSON result)
        {
//@@@            Debug.Assert(!have_value);
            have_value = true;
            value      = result;
        }
 protected abstract void handle_result(GeneralizedThingJSON new_result);