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 constructorSelectParserSingle(VarNameAdapter adapter)
-
Method Summary
All Methods Instance Methods Concrete Methods 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 RequestSingle
getNewRequest()
Select
getRequest()
void
parse(com.fasterxml.jackson.databind.JsonNode request)
void
parseQueryOnly(java.lang.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, getAdapter, getRootNode, getSource, hasFullTextQuery, parseOrderByFilter
-
-
-
-
Constructor Detail
-
SelectParserSingle
public SelectParserSingle()
Empty constructor
-
SelectParserSingle
public SelectParserSingle(VarNameAdapter adapter)
- Parameters:
adapter
- VarNameAdapter
-
-
Method Detail
-
getNewRequest
protected RequestSingle getNewRequest()
- Specified by:
getNewRequest
in classAbstractParser<RequestSingle>
- Returns:
- a new Request
-
parse
public void parse(com.fasterxml.jackson.databind.JsonNode request) throws InvalidParseOperationException
- Specified by:
parse
in classAbstractParser<RequestSingle>
- Parameters:
request
- containing a parsed JSON as { $query : query, $filter : filter, $projection : projection }- Throws:
InvalidParseOperationException
- if request could not parse to JSON
-
parseQueryOnly
public void parseQueryOnly(java.lang.String query) throws InvalidParseOperationException
- Overrides:
parseQueryOnly
in classRequestParserSingle
- 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 addallFields
- 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
-
getRequest
public Select getRequest()
- Overrides:
getRequest
in classAbstractParser<RequestSingle>
- Returns:
- the Request
-
-