@Override
    public Object parse(IGroup group, JsonRuleParser parser) {
        // rules
        BasicDBList operates = new BasicDBList();
        for (JsonRule jsonRule : group.getRules()) {
            operates.add(parser.parse(jsonRule));
        }

        // AND or OR
        BasicDBObject andOrObj = new BasicDBObject();
        andOrObj.append(EnumCondition.AND.equals(group.getCondition()) ? "$and" : "$or", operates);

        // Not
        if (group.getNot() != null && group.getNot()) {
            BasicDBList list = new BasicDBList();
            list.add(andOrObj);
            return new BasicDBObject("$nor", list);
        }
        return andOrObj;
    }
@ Override public Object parse ( IGroup group , JsonRuleParser parser ) { BasicDBList operates = new BasicDBList ( ) ; for ( JsonRule jsonRule : group . getRules ( ) ) { operates . add ( parser . parse ( jsonRule ) ) ; } BasicDBObject andOrObj = new BasicDBObject ( ) ; andOrObj . append ( EnumCondition . AND . equals ( group . getCondition ( ) ) ? "$and" : "$or" , operates ) ; if ( group . getNot ( ) != null && group . getNot ( ) ) { BasicDBList list = new BasicDBList ( ) ; list . add ( andOrObj ) ; return new BasicDBObject ( "$nor" , list ) ; } return andOrObj ; }
解析
@param group
@param parser
@return