use of org.jnosql.artemis.document.query.DocumentQueryParserUtil.ConditionResult in project jnosql-artemis by eclipse.
the class DocumentQueryDeleteParser method parse.
public DocumentDeleteQuery parse(String methodName, Object[] args, ClassRepresentation representation, Converters converters) {
String[] tokens = methodName.replace(PREFIX, DocumentQueryParserUtil.EMPTY).split(TOKENIZER);
DocumentCondition condition = null;
int index = 0;
for (String token : tokens) {
if (token.startsWith(DocumentQueryParserUtil.AND)) {
ConditionResult result = and(args, index, token, methodName, representation, condition, converters);
condition = result.getCondition();
index = result.getIndex();
} else if (token.startsWith(DocumentQueryParserUtil.OR)) {
ConditionResult result = or(args, index, token, methodName, representation, condition, converters);
condition = result.getCondition();
index = result.getIndex();
} else {
condition = toCondition(token, index, args, methodName, representation, converters);
index++;
}
}
return new ArtemisDocumentDeleteQuery(representation.getName(), condition);
}
Aggregations