Package fr.gouv.vitam.common.database.parser.query

# Class QueryParserHelper

java.lang.Object
fr.gouv.vitam.common.database.builder.query.QueryHelper
fr.gouv.vitam.common.database.parser.query.QueryParserHelper

public class QueryParserHelper extends QueryHelper
Query from Parser Helper

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `QueryParserHelper()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static final Query[]`
  `analyzeArrayCommand(BuilderToken.QUERY query, com.fasterxml.jackson.databind.JsonNode commands, VarNameAdapter adapter)`
  Analyze an array of commands
  `static final CompareQuery`
  `eq(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final ExistsQuery`
  `exists(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final MltQuery`
  `flt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final BuilderToken.QUERY`
  `getRequestId(String queryroot)`
  Compute the QUERY from command
  `static final CompareQuery`
  `gt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final CompareQuery`
  `gte(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final InQuery`
  `in(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `protected static boolean`
  `isCommandAsFullText(BuilderToken.QUERY query)`
  `static final ExistsQuery`
  `isNull(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final CompareQuery`
  `lt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final CompareQuery`
  `lte(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final MatchQuery`
  `match(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final MatchQuery`
  `matchAll(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final MatchQuery`
  `matchPhrase(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final MatchQuery`
  `matchPhrasePrefix(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final ExistsQuery`
  `missing(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final MltQuery`
  `mlt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final CompareQuery`
  `ne(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final SearchQuery`
  `nestedSearch(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final InQuery`
  `nin(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final NopQuery`
  `nop()`
  Constructs a null operation (nop) query, meaning there is no 'where' demand.
  `static final PathQuery`
  `path(com.fasterxml.jackson.databind.JsonNode array, VarNameAdapter adapter)`
  `static final Query`
  `query(String refCommand, com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  Transform command to query
  `static final RangeQuery`
  `range(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final SearchQuery`
  `regex(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final SearchQuery`
  `search(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final CompareQuery`
  `size(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final TermQuery`
  `term(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`
  `static final WildcardQuery`
  `wildcard(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter)`

  ### Methods inherited from class fr.gouv.vitam.common.database.builder.query.QueryHelper

  `and, eq, eq, eq, eq, eq, exists, flt, gt, gt, gt, gt, gt, gte, gte, gte, gte, gte, in, in, in, in, in, isNull, lt, lt, lt, lt, lt, lte, lte, lte, lte, lte, match, matchAll, matchPhrase, matchPhrasePrefix, missing, mlt, ne, ne, ne, ne, ne, nestedSearch, nin, nin, nin, nin, nin, not, or, path, range, range, range, range, regex, search, size, term, term, term, term, term, term, wildcard`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### QueryParserHelper

    protected QueryParserHelper()

- ## Method Details

  - ### path

    public static final PathQuery path(com.fasterxml.jackson.databind.JsonNode array, VarNameAdapter adapter)
    Parameters:
      `array` - primary list of path in the future PathQuery
      `adapter` - VarNameAdapter
    Returns:
      a PathQuery

  - ### eq

    public static final CompareQuery eq(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using EQ comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### ne

    public static final CompareQuery ne(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using NE comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### lt

    public static final CompareQuery lt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using LT (less than) comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### lte

    public static final CompareQuery lte(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using LTE (less than or equal) comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### gt

    public static final CompareQuery gt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using GT (greater than) comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### gte

    public static final CompareQuery gte(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using GTE (greater than or equal) comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### size

    public static final CompareQuery size(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a CompareQuery using SIZE comparator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### exists

    public static final ExistsQuery exists(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidCreateOperationException, InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      an ExistsQuery
    Throws:
      `InvalidCreateOperationException` - using Exists operator
      `InvalidParseOperationException` - if could not parse to JSON

  - ### missing

    public static final ExistsQuery missing(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidCreateOperationException, InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      an ExistsQuery using Missing operator
    Throws:
      `InvalidCreateOperationException` - using Exists operator
      `InvalidParseOperationException` - if could not parse to JSON

  - ### isNull

    public static final ExistsQuery isNull(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidCreateOperationException, InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      an ExistsQuery using isNull operator
    Throws:
      `InvalidCreateOperationException` - using Exists operator
      `InvalidParseOperationException` - if could not parse to JSON

  - ### in

    public static final InQuery in(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      an InQuery using IN operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### nin

    public static final InQuery nin(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      an InQuery using NIN (not in) operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### match

    public static final MatchQuery match(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a MatchQuery using MATCH operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### matchAll

    public static final MatchQuery matchAll(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a MatchQuery using MATCH operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### matchPhrase

    public static final MatchQuery matchPhrase(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a MatchQuery using MATCH_PHRASE operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### matchPhrasePrefix

    public static final MatchQuery matchPhrasePrefix(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a MatchQuery using MATCH_PHRASE_PREFIX operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### regex

    public static final SearchQuery regex(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a SearchQuery using REGEX operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### search

    public static final SearchQuery search(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a SearchQuery using SEARCH operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### nestedSearch

    public static final SearchQuery nestedSearch(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a SearchQuery using nested search mode
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### term

    public static final TermQuery term(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a TermQuery
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### wildcard

    public static final WildcardQuery wildcard(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a WildcardQuery
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### flt

    public static final MltQuery flt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a MltQuery using a FLT (fuzzy like this) operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### mlt

    public static final MltQuery mlt(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a MltQuery using a MLT (more like this) operator
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### range

    public static final RangeQuery range(com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException
    Parameters:
      `command` - JsonNode
      `adapter` - VarNameAdapter
    Returns:
      a RangeQuery
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON

  - ### nop

    public static final NopQuery nop() throws InvalidCreateOperationException
    Constructs a null operation (nop) query, meaning there is no 'where' demand.
    Returns:
      a NopQuery
    Throws:
      `InvalidCreateOperationException` - using NOP operator

  - ### query

    public static final Query query(String refCommand, com.fasterxml.jackson.databind.JsonNode command, VarNameAdapter adapter) throws InvalidParseOperationException, InvalidCreateOperationException
    Transform command to query
    Parameters:
      `refCommand` - ref of command
      `command` - command
      `adapter` - dapater
    Returns:
      query
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON
      `InvalidCreateOperationException` - if could not create the query

  - ### getRequestId

    public static final BuilderToken.QUERY getRequestId(String queryroot) throws InvalidParseOperationException
    Compute the QUERY from command
    Parameters:
      `queryroot` - String
    Returns:
      the QUERY
    Throws:
      `InvalidParseOperationException` - if queryroot could not parse to JSON

  - ### analyzeArrayCommand

    public static final Query[] analyzeArrayCommand(BuilderToken.QUERY query, com.fasterxml.jackson.databind.JsonNode commands, VarNameAdapter adapter) throws InvalidParseOperationException, InvalidCreateOperationException
    Analyze an array of commands
    Parameters:
      `query` - query
      `commands` - commands
      `adapter` - adapter
    Returns:
      array of Queries
    Throws:
      `InvalidParseOperationException` - if could not parse to JSON
      `InvalidCreateOperationException` - if could not create the query

  - ### isCommandAsFullText

    protected static boolean isCommandAsFullText(BuilderToken.QUERY query)