Class AbstractPathProcessor

    • Constructor Detail

      • AbstractPathProcessor

        public AbstractPathProcessor​(Source source)
        Parameters:
        source - The JSON stream source to process
    • Method Detail

      • isProcessable

        protected abstract boolean isProcessable​(JsonPath path,
                                                 JsonElement element)
        Parameters:
        path - The current JSON path
        element - The current JSON stream element
        Returns:
        True if process with the given parameter should get called
      • process

        protected abstract void process​(JsonPath path,
                                        JsonElement element)
        Processes the current JSON stream element
        Parameters:
        path - The current JSON path
        element - The current JSON stream element
      • seekToPath

        protected JsonElement seekToPath​(String path)
        Requests the next JSON stream elements from the source until the bread crumb matches the given JSON path. Passed elements don't get processed or stored in the output buffer. They get lost! Calls the contains function to evaluate the query.
        Parameters:
        path - JSON path query
        Returns:
        The JSON stream element matching the query
      • seekToNext

        protected JsonElement seekToNext()
        Requests the next JSON stream element.
        Returns:
        The next JSON stream element
      • seekToNext

        protected JsonElement seekToNext​(int steps)
        Request x times the next JSON stream element defined by the steps parameter. Passed elements don't get processed or stored in the output buffer. They get lost!
        Parameters:
        steps - Number of steps to execute next; must be larger then zero
        Returns:
        Null if source has no more elements
      • processToPath

        protected JsonElement processToPath​(String path)
        Requests the next JSON stream elements from the source until the bread crumb matches the given JSON path. Passed elements don't get processed but stored in the output buffer. Calls the contains function to evaluate the query.
        Parameters:
        path - JSON path query
        Returns:
        The JSON stream element matching the query
      • getCurrentJsonPath

        protected JsonPath getCurrentJsonPath()
        Returns:
        The current JSON path