public abstract class RequestParserSingle extends AbstractParser<RequestSingle>
Modifier and Type | Field and Description |
---|---|
protected static int |
FILTER_POS |
protected static int |
QUERY_POS |
adapter, hasFullTextCurrentQuery, hasFullTextQuery, request, rootNode, sourceRequest
Constructor and Description |
---|
RequestParserSingle()
Constructor for Internal API
|
RequestParserSingle(VarNameAdapter adapter)
Constructor for Masterdata
|
Modifier and Type | Method and Description |
---|---|
void |
addCondition(Query condition)
Allow to add one condition to the current parsed Request
Example:
|
protected void |
analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command)
{ expression }
|
protected void |
filterParse(com.fasterxml.jackson.databind.JsonNode rootNode)
Filter part
|
int |
getLastDepth() |
boolean |
hintCache() |
boolean |
hintNoTimeout() |
BuilderToken.FILTERARGS |
model() |
protected void |
parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) |
protected void |
parseQueryOnly(String query) |
protected void |
queryParse(com.fasterxml.jackson.databind.JsonNode rootNode)
{ query } if one level only
|
String |
toString() |
analyzeArrayCommand, analyzeOneCommand, getNewRequest, getRequest, getRequestId, getRootNode, getSource, hasFullTextQuery, isCommandAsFullText, parse
protected static final int QUERY_POS
protected static final int FILTER_POS
public RequestParserSingle()
public RequestParserSingle(VarNameAdapter adapter)
adapter
- VarNameAdapterprotected void parseJson(com.fasterxml.jackson.databind.JsonNode jsonRequest) throws InvalidParseOperationException
parseJson
in class AbstractParser<RequestSingle>
jsonRequest
- containing a parsed JSON as [ {query}, {filter} ] or { $query : query, $filter : filter }InvalidParseOperationException
- if jsonRequest could not parse to JSONprotected void parseQueryOnly(String query) throws InvalidParseOperationException
query
- containing only the JSON query part (no filter)InvalidParseOperationException
- if query could not parse to JSON or sanity check to query is in errorprotected void filterParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
rootNode
- JsonNodeInvalidParseOperationException
- if rootNode could not parse to JSONprotected void queryParse(com.fasterxml.jackson.databind.JsonNode rootNode) throws InvalidParseOperationException
rootNode
- JsonNodeInvalidParseOperationException
- if rootNode could not parse to JSONprotected void analyzeRootQuery(com.fasterxml.jackson.databind.JsonNode command) throws InvalidParseOperationException, InvalidCreateOperationException
command
- JsonNodeInvalidParseOperationException
- if command is null or command could not parse to JSONInvalidCreateOperationException
- if could not set query to request or analyzeOneCommand is in errorpublic void addCondition(Query condition) throws InvalidCreateOperationException, InvalidParseOperationException
SelectParserSingle parser = new SelectParserSingle(...);
parser.parse(jsonQuery);
parser.addCondition(eq(FieldName, value));
JsonNode newJsonQuery = parser.getRootNode();
condition
- the condition to addInvalidCreateOperationException
- when invalid create query exception occurredInvalidParseOperationException
- hen invalid parse data to create querypublic boolean hintNoTimeout()
hintNoTimeout
in class AbstractParser<RequestSingle>
public int getLastDepth()
getLastDepth
in class AbstractParser<RequestSingle>
public BuilderToken.FILTERARGS model()
model
in class AbstractParser<RequestSingle>
public boolean hintCache()
hintCache
in class AbstractParser<RequestSingle>
Copyright © 2018 Vitam. All rights reserved.