class FilterUtils {

    public static IFilter createFilter(String where) {
        if (StringUtils.isEmpty(where)) {
            return null;
        }

        MySqlExprVisitor visitor = MySqlExprVisitor.parser(where);
        Comparable value = visitor.getColumnOrValue();
        if (value instanceof IFilter) {
            return (IFilter) value;
        } else if (value instanceof ISelectable) {
            throw new IllegalArgumentException("不合法的filter表达式:" + where);
        } else {
            return visitor.buildConstanctFilter(value);
        }
    }

}