final List<String> arguments;
if (op.minArguments > 0) {
arguments = OStringSerializerHelper.getParameters(part);
if (arguments.size() < op.minArguments || arguments.size() > op.maxArguments)
throw new OQueryParsingException(iQueryToParse.text, "Syntax error: field operator '" + op.keyword + "' needs "
+ (op.minArguments == op.maxArguments ? op.minArguments : op.minArguments + "-" + op.maxArguments)
+ " argument(s) while has been received " + arguments.size(), iQueryToParse.currentPos + separatorPos);
} else
arguments = null;
// SPECIAL OPERATION FOUND: ADD IT IN TO THE CHAIN
if (operationsChain == null)
operationsChain = new ArrayList<OPair<Integer, List<String>>>();
operationsChain.add(new OPair<Integer, List<String>>(op.id, arguments));
separatorPos = partUpperCase.indexOf(OStringSerializerHelper.PARENTHESIS_END)
+ OSQLFilterFieldOperator.CHAIN_SEPARATOR.length();
operatorFound = true;
break;
}
if (!operatorFound) {
separatorPos = partUpperCase.indexOf(OSQLFilterFieldOperator.CHAIN_SEPARATOR, 0);
// CHECK IF IT'S A FIELD
int posOpenBrace = part.indexOf('(');
if (posOpenBrace == -1 || posOpenBrace > separatorPos && separatorPos > -1) {
// YES, SEEMS A FIELD
String chainedFieldName = separatorPos > -1 ? part.substring(0, separatorPos) : part;
if (operationsChain == null)
operationsChain = new ArrayList<OPair<Integer, List<String>>>();
final List<String> list = new ArrayList<String>();
list.add(chainedFieldName);
if (chainedFieldName.charAt(0) == '@')
operationsChain.add(new OPair<Integer, List<String>>(OSQLFilterFieldOperator.ATTRIB.id, list));
else
operationsChain.add(new OPair<Integer, List<String>>(OSQLFilterFieldOperator.FIELD.id, list));
} else
// ERROR: OPERATOR NOT FOUND OR MISPELLED
throw new OQueryParsingException(iQueryToParse.text,
"Syntax error: field operator not recognized between the supported ones: "
+ Arrays.toString(OSQLFilterFieldOperator.OPERATORS), iQueryToParse.currentPos + separatorPos);
}
if (separatorPos >= partUpperCase.length())