public static MqlCriterionFunction createMqlDocumentFunction(
final String functionName, final String operatorName,
final boolean allowQueryGroup, final boolean allowQuery,
final int exactArgs, final int minArgs, final int maxArgs, final Class<?>... types) {
return new AbstractMqlCriterionFunction() {
protected void init() {
setFunctionName(functionName);
setAllowQueryGroup(allowQueryGroup);
setAllowQuery(allowQuery);
setExactArgs(exactArgs);