i, On Thu, Feb 19, 2009 at 5:54 PM, Hammond, Steve <[email protected]> wrote: > I am getting a filter in on the wire. > > I want to use a visitor method and remove some pieces (a memberof) > > But I need to use the original filter also. > > > > I was hoping for a ExprNode.clone function so that I can have a copy of the > filter that I can send the visitor to do the alterations to the copy, > leaving the original filter pristine.
We don't have a clone() method for filters. Sigh :/ > I tried to hack it together with (FilterParser.parse(filter.toString()) but > this fails when my memberOf groupDN has parenthesis in it. Well, the parser might not be perfect :/ Worth a JIRA, IMO. > > Just thought I would ask before I got very far on adding a clone to the > ExprNode Interface There are three things we would like to add : - a clone() method which works - a decent equals method, comparing two filters and accept filters which are not ordered the same way (ie, (|(a=*)(b=*)) should be equal to (|(b=*)(a=*)) - a decent toString() method - I would call it asString() - returning a String representation of the current filter, not a String decorating the filter with some few infos, like the number of nodes, etc. Well, we also need a volunteer to jump into the mud too :) -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
