internal override JsonValue Query(JsonPath path)
        {
            JsonPathSection section = path.Current;

            if (section != null)
            {
                path.Pop();
                if (section.indexerPesent)
                {
                    int indexer = section.indexerValue;
                    if (indexer >= _values.Count)
                    {
                        if (path.PathMode == JsonPathEvaluationMode.Strict)
                        {
                            throw new Exception("Path error in strict mode");
                        }
                        else
                        {
                            return(null);
                        }
                    }
                    else
                    {
                        return(_values[indexer].Query(path));
                    }
                }
                else
                {
                    if (path.Current == null)
                    {
                        return(this);
                    }
                    else if (_values.Count > 0)
                    {
                        return(_values[0].Query(path));
                    }
                    else if (path.PathMode == JsonPathEvaluationMode.Strict)
                    {
                        throw new Exception("Path error in strict mode");
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            return(this);
        }
Beispiel #2
0
 internal override JsonValue Query(JsonPath path)
 {
     return(this);
 }
Beispiel #3
0
 internal abstract JsonValue Query(JsonPath path);