directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hammond, Steve" <>
Subject RE: [APacheDS] do I need to write a way to clone a filter?
Date Fri, 20 Feb 2009 16:54:36 GMT
Ok, 2 out of 3 have patch submissions now.

-----Original Message-----
From: [] On Behalf Of Emmanuel Lecharny
Sent: Thursday, February 19, 2009 10:25 AM
To: Apache Directory Developers List
Subject: Re: [APacheDS] do I need to write a way to clone a filter?


On Thu, Feb 19, 2009 at 5:54 PM, Hammond, Steve
<> 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 :)

Emmanuel L├ęcharny

View raw message