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
Abstract class implementing Parser for a Request
Common abstract for both Multiple and Single Request
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected VarNameAdapterprotected booleanCurrent analyzed query to be computed by a full text indexprotected booleanContains queries to be computed by a full text indexprotected Eprotected com.fasterxml.jackson.databind.JsonNodeprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected QueryanalyzeOneCommand(String refCommand, com.fasterxml.jackson.databind.JsonNode command) protected FacetanalyzeOneFacet(com.fasterxml.jackson.databind.JsonNode facet, BuilderToken.FACET facetCommand) Generate a Facet from a Json + commandabstract intprotected abstract Ecom.fasterxml.jackson.databind.JsonNodefinal booleanabstract booleanabstract booleanabstract BuilderToken.FILTERARGSmodel()abstract voidparse(com.fasterxml.jackson.databind.JsonNode jsonRequest) protected voidparseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) protected voidparseOrderByFilter(com.fasterxml.jackson.databind.JsonNode filterNode)
-
Field Details
-
adapter
-
sourceRequest
-
request
-
hasFullTextQuery
protected boolean hasFullTextQueryContains queries to be computed by a full text index -
hasFullTextCurrentQuery
protected boolean hasFullTextCurrentQueryCurrent 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
- Returns:
- the source
-
getRootNode
public com.fasterxml.jackson.databind.JsonNode getRootNode()- Returns:
- the rootNode
-
getRequest
- Returns:
- the Request
-
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
- Returns:
- the adapter
-
analyzeOneCommand
protected Query analyzeOneCommand(String refCommand, com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException -
getLastDepth
public abstract int getLastDepth()- Returns:
- int the depth of the query
-
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 jsonfacetCommand- facet command- Returns:
- Facet
- Throws:
InvalidCreateOperationException- parsing errorInvalidParseOperationException- invalid command type
-