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

# Class AbstractParser<E extends AbstractRequest>

java.lang.Object
fr.gouv.vitam.common.database.parser.request.AbstractParser<E>

Type Parameters:
  `E` - is one of RequestMultiple or RequestSingle

Direct Known Subclasses:
  `RequestParserMultiple`, `RequestParserSingle`

public abstract class AbstractParser<E extends AbstractRequest> extends Object
Abstract class implementing Parser for a Request Common abstract for both Multiple and Single Request

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected VarNameAdapter`
  `adapter`
  `protected boolean`
  `hasFullTextCurrentQuery`
  Current analyzed query to be computed by a full text index
  `protected boolean`
  `hasFullTextQuery`
  Contains queries to be computed by a full text index
  `protected E`
  `request`
  `protected com.fasterxml.jackson.databind.JsonNode`
  `rootNode`
  `protected String`
  `sourceRequest`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractParser()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Query`
  `analyzeOneCommand(String refCommand, com.fasterxml.jackson.databind.JsonNode command)`
  `protected Facet`
  `analyzeOneFacet(com.fasterxml.jackson.databind.JsonNode facet, BuilderToken.FACET facetCommand)`
  Generate a Facet from a Json + command
  `VarNameAdapter`
  `getAdapter()`
  `abstract int`
  `getLastDepth()`
  `protected abstract E`
  `getNewRequest()`
  `E`
  `getRequest()`
  `com.fasterxml.jackson.databind.JsonNode`
  `getRootNode()`
  `String`
  `getSource()`
  `final boolean`
  `hasFullTextQuery()`
  `abstract boolean`
  `hintCache()`
  `abstract boolean`
  `hintNoTimeout()`
  `abstract BuilderToken.FILTERARGS`
  `model()`
  `abstract void`
  `parse(com.fasterxml.jackson.databind.JsonNode jsonRequest)`
  `protected void`
  `parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest)`
  `protected void`
  `parseOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterNode)`

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

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

- ## Field Details

  - ### adapter

    protected VarNameAdapter adapter

  - ### sourceRequest

    protected String sourceRequest

  - ### request

    protected E extends AbstractRequest request

  - ### hasFullTextQuery

    protected boolean hasFullTextQuery
    Contains queries to be computed by a full text index

  - ### hasFullTextCurrentQuery

    protected boolean hasFullTextCurrentQuery
    Current analyzed query to be computed by a full text index

  - ### rootNode

    protected com.fasterxml.jackson.databind.JsonNode rootNode

- ## Constructor Details

  - ### AbstractParser

    public AbstractParser()

- ## Method Details

  - ### getSource

    public String getSource()
    Returns:
      the source

  - ### getRootNode

    public com.fasterxml.jackson.databind.JsonNode getRootNode()
    Returns:
      the rootNode

  - ### getRequest

    public E getRequest()
    Returns:
      the Request

  - ### getNewRequest

    protected abstract E getNewRequest()
    Returns:
      a new Request

  - ### parse

    public abstract void parse(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
    Parameters:
      `jsonRequest` - containing a parsed JSON as { $roots: root, $query : query, $filter : filter }
    Throws:
      `InvalidParseOperationException` - if jsonRequest could not parse to JSON

  - ### parseJson

    protected void parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
    Parameters:
      `jsonRequest` - containing a parsed JSON as { $roots: root, $query : query, $filter : filter }
    Throws:
      `InvalidParseOperationException` - if jsonRequest could not parse to JSON

  - ### hasFullTextQuery

    public final boolean hasFullTextQuery()
    Returns:
      the hasFullTextQuery

  - ### getAdapter

    public VarNameAdapter getAdapter()
    Returns:
      the adapter

  - ### analyzeOneCommand

    protected Query analyzeOneCommand(String refCommand, com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException
    Throws:
      `InvalidParseOperationException`
      `InvalidCreateOperationException`

  - ### getLastDepth

    public abstract int getLastDepth()
    Returns:
      int the depth of the query

  - ### model

    public abstract BuilderToken.FILTERARGS model()
    Returns:
      FILTERARGS the filter argument

  - ### hintNoTimeout

    public abstract boolean hintNoTimeout()
    Returns:
      true if not time out

  - ### hintCache

    public abstract boolean hintCache()
    Returns:
      true if not cache hint

  - ### parseOrderByFilter

    protected void parseOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterNode) throws InvalidParseOperationException
    Throws:
      `InvalidParseOperationException`

  - ### analyzeOneFacet

    protected Facet analyzeOneFacet(com.fasterxml.jackson.databind.JsonNode facet, BuilderToken.FACET facetCommand) throws InvalidCreateOperationException, InvalidParseOperationException
    Generate a Facet from a Json + command
    Parameters:
      `facet` - facet as json
      `facetCommand` - facet command
    Returns:
      Facet
    Throws:
      `InvalidCreateOperationException` - parsing error
      `InvalidParseOperationException` - invalid command type