Class RequestParserHelper


  • public class RequestParserHelper
    extends java.lang.Object
    RequestParser Helper to get the correct Request Parser from String or from Json.
    Note however that is should be better to create the correct Parser based one the source of the request:
    - POST: insert
    - PATCH: update
    - DELETE: delete
    - GET: select
    - PUT: delete and insert
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static RequestParserMultiple getParser​(com.fasterxml.jackson.databind.JsonNode jsonRequest)
      Create one Parser for Internal API according to:
      InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
      UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
      SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
      DeleteParser if { $roots: roots, $query : query, $filter : multi }
      static RequestParserMultiple getParser​(com.fasterxml.jackson.databind.JsonNode jsonRequest, VarNameAdapter varNameAdapter)
      Create one Parser for Metadata according to:
      InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
      UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
      SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
      DeleteParser if { $roots: roots, $query : query, $filter : multi }
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getParser

        public static RequestParserMultiple getParser​(com.fasterxml.jackson.databind.JsonNode jsonRequest)
                                               throws InvalidParseOperationException
        Create one Parser for Internal API according to:
        InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
        UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
        SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
        DeleteParser if { $roots: roots, $query : query, $filter : multi }
        Parameters:
        jsonRequest - the request to parse
        Returns:
        the appropriate RequestParser
        Throws:
        InvalidParseOperationException - if jsonRequest could not parse to JSON
      • getParser

        public static RequestParserMultiple getParser​(com.fasterxml.jackson.databind.JsonNode jsonRequest,
                                                      VarNameAdapter varNameAdapter)
                                               throws InvalidParseOperationException
        Create one Parser for Metadata according to:
        InsertParser if { $roots: root, $query : query, $filter : filter, $data : data}
        UpdateParser if { $roots: root, $query : query, $filter : filter, $action : action }
        SelectParser if { $roots: roots, $query : query, $filter : filter, $projection : projection }
        DeleteParser if { $roots: roots, $query : query, $filter : multi }
        Parameters:
        jsonRequest - the request to parse
        varNameAdapter - the VarNameAdapter to use with the created Parser
        Returns:
        the appropriate RequestParser
        Throws:
        InvalidParseOperationException - if jsonRequest could not parse to JSON