Package fr.gouv.vitam.common.database.parser.request.single

# Class SelectParserSingle

java.lang.Object
fr.gouv.vitam.common.database.parser.request.AbstractParser<RequestSingle>
fr.gouv.vitam.common.database.parser.request.single.RequestParserSingle
fr.gouv.vitam.common.database.parser.request.single.SelectParserSingle

public class SelectParserSingle extends RequestParserSingle
Select Parser: { $query : query, $filter : filter, $projection : projection }

- ## Field Summary

  ### Fields inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser

  `adapter, hasFullTextCurrentQuery, hasFullTextQuery, request, rootNode, sourceRequest`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SelectParserSingle()`
  Empty constructor
  `SelectParserSingle(VarNameAdapter adapter)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addProjection(com.fasterxml.jackson.databind.node.ObjectNode slice, com.fasterxml.jackson.databind.node.ObjectNode allFields)`
  Add the new Projection slice to the current Projection.
  `protected void`
  `facetsParse(com.fasterxml.jackson.databind.JsonNode rootNode)`
  Parse facets
  `static final BuilderToken.FACET`
  `getFacetCommand(com.fasterxml.jackson.databind.JsonNode facet)`
  Get the facet command
  `protected RequestSingle`
  `getNewRequest()`
  `Select`
  `getRequest()`
  `void`
  `parse(com.fasterxml.jackson.databind.JsonNode request)`
  `void`
  `parseQueryOnly(String query)`
  `void`
  `projectionParse(com.fasterxml.jackson.databind.JsonNode rootNode)`
  $fields : {name1 : 0/1, name2 : 0/1, ...}, $usage : contractId

  ### Methods inherited from class fr.gouv.vitam.common.database.parser.request.single.RequestParserSingle

  `addCondition, analyzeRootQuery, filterParse, getLastDepth, hintCache, hintNoTimeout, model, parseJson, queryParse, toString`

  ### Methods inherited from class fr.gouv.vitam.common.database.parser.request.AbstractParser

  `analyzeOneCommand, analyzeOneFacet, getAdapter, getRootNode, getSource, hasFullTextQuery, parseOrderByFilter`

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

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

- ## Constructor Details

  - ### SelectParserSingle

    public SelectParserSingle()
    Empty constructor

  - ### SelectParserSingle

    public SelectParserSingle(VarNameAdapter adapter)
    Parameters:
      `adapter` - VarNameAdapter

- ## Method Details

  - ### getNewRequest

    protected RequestSingle getNewRequest()
    Specified by:
      `getNewRequest` in class `AbstractParser<RequestSingle>`
    Returns:
      a new Request

  - ### parse

    public void parse(com.fasterxml.jackson.databind.JsonNode request) throws InvalidParseOperationException
    Specified by:
      `parse` in class `AbstractParser<RequestSingle>`
    Parameters:
      `request` - containing a parsed JSON as { $query : query, $filter : filter, $projection : projection }
    Throws:
      `InvalidParseOperationException` - if request could not parse to JSON

  - ### facetsParse

    protected void facetsParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
    Parse facets
    Parameters:
      `rootNode` - JsonNode
    Throws:
      `InvalidParseOperationException` - if rootNode could not parse to JSON

  - ### parseQueryOnly

    public void parseQueryOnly(String query) throws InvalidParseOperationException
    Overrides:
      `parseQueryOnly` in class `RequestParserSingle`
    Parameters:
      `query` - containing only the JSON request part (no filter neither projection nor roots)
    Throws:
      `InvalidParseOperationException` - if query could not parse to projection

  - ### projectionParse

    public void projectionParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
    $fields : {name1 : 0/1, name2 : 0/1, ...}, $usage : contractId
    Parameters:
      `rootNode` - JsonNode
    Throws:
      `InvalidParseOperationException` - if rootNode could not parse to projection or check sanity to rootNode is in error

  - ### addProjection

    public void addProjection(com.fasterxml.jackson.databind.node.ObjectNode slice, com.fasterxml.jackson.databind.node.ObjectNode allFields) throws InvalidParseOperationException
    Add the new Projection slice to the current Projection. If the existing projection is empty, the allFields is added first.
    Parameters:
      `slice` - the projection to add
      `allFields` - the default fields to add if none exists yet
    Throws:
      `InvalidParseOperationException` - if slice or allFields is null or check sanity to them is in error

  - ### getFacetCommand

    public static final BuilderToken.FACET getFacetCommand(com.fasterxml.jackson.databind.JsonNode facet) throws InvalidParseOperationException
    Get the facet command
    Parameters:
      `facet` - facet
    Returns:
      FACET command
    Throws:
      `InvalidParseOperationException` - when valid command could not be found

  - ### getRequest

    public Select getRequest()
    Overrides:
      `getRequest` in class `AbstractParser<RequestSingle>`
    Returns:
      the Request