Class JsonProcessor


  • public class JsonProcessor
    extends Object
    Processes the query against given Json and generates de results
    • Constructor Detail

      • JsonProcessor

        public JsonProcessor​(com.fasterxml.jackson.databind.JsonNode json,
                             JsonQueryClause query,
                             SqlJsonConfig config)
        Constructor receiving JSON and query.
        Parameters:
        json - json to be queried
        query - SQL to be executed
    • Method Detail

      • process

        public JsonResultSet process()
                              throws Exception
        Main processor method.
        Returns:
        List of results found
        Throws:
        Exception - in case of any failure
      • narrowResultElements

        public List<LinkedHashMap<String,​com.fasterxml.jackson.databind.JsonNode>> narrowResultElements​(List<com.fasterxml.jackson.databind.JsonNode> elements)
                                                                                                       throws SQLSyntaxErrorException
        Return the selected columns. Star will return all fields . (dot) will return a json
        Parameters:
        elements - all elements to filter columns
        Returns:
        List rows, where rows are a map of cols
        Throws:
        SQLSyntaxErrorException - in case selectors are invalid