Beispiel #1
0
    private void  fromJSONArgumentData(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        TypeArgumentData or_result = new TypeArgumentData();
        bool             or_done   = false;

        if (!or_done)
        {
            try
            {
                SportsStandingsArgumentWildCardJSON convert_classy = SportsStandingsArgumentWildCardJSON.from_json(json_value, ignore_extras, true);
                or_result.u.choice0 = convert_classy;
                or_result.key       = 0;
                or_done             = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            try
            {
                SportsSeasonJSON convert_classy = SportsSeasonJSON.from_json(json_value, ignore_extras, true);
                or_result.u.choice1 = convert_classy;
                or_result.key       = 1;
                or_done             = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            try
            {
                SportsStandingsArgumentConferenceJSON convert_classy = SportsStandingsArgumentConferenceJSON.from_json(json_value, ignore_extras, true);
                or_result.u.choice2 = convert_classy;
                or_result.key       = 2;
                or_done             = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            try
            {
                SportsStandingsArgumentDivisionalJSON convert_classy = SportsStandingsArgumentDivisionalJSON.from_json(json_value, ignore_extras, true);
                or_result.u.choice3 = convert_classy;
                or_result.key       = 3;
                or_done             = true;
            }
            catch (Exception)
            {
            }
        }
        if (!or_done)
        {
            throw new Exception("The value for field ArgumentData of SportsStandingsArgumentJSON is not one of the allowed values.");
        }
        setArgumentData(or_result);
        switch (or_result.key)
        {
        case 0:
            break;

        case 1:
            break;

        case 2:
            break;

        case 3:
            break;

        default:
            Debug.Assert(false);
            break;
        }
    }