commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Heimann <m...@stefanheimann.net>
Subject Re: Re: digester 2.0 [WAS Re: [digester] [PROPOSAL] More pattern matching flexibility]
Date Wed, 04 Sep 2002 22:40:30 GMT
Hi,

On Wed, Sep 04, 2002 at 09:46:56PM +0100, robert burrell donkin wrote:
> On Wednesday, September 4, 2002, at 08:30 PM, Christopher Lenz wrote:
> 
> <snip>
[...] 
> i'm pretty happy with the way that this is heading but maybe it'd be 
> easier for more people to review these changes and suggest improvements if 
> we had them in cvs. maybe a branch is the right way to go forward. (we can 
> merge back once everyone's happy with the changes.)
> 
> comments?

yes, I think a branch would be good. 

One thing I noticed when looking at the patch: 

Christoph introduced the namespaceURI instance variable to the
digester. The get/set methods for the namespaceURI work now directly
with this variable instead of delegating the call to a Rules
implementation.

I think the namespace-uri is only relevant for some matchers (for
example SimpleMatcher and ExtendedMatcher). I would like to write a
matcher with namespace support for patterns. The namespace-uri would
not make sense for such a matcher. Maybe we could write the
setNamespaceURI like this to retain backward compatibility:

public void setNamespaceURI(String uri) {
    if (getMatcher() instanceof RulesBase) {
       ((RulesBase)getMatcher()).setNamespaceURI(uri);
    } else { 
        throw new UnsupportedOperationException();
   }
}

The same problems appears with the setNamespaceAware method. It's
nonsense to use a matcher with namespace support if the digester
creates a SAXParser that is not namespace aware. Again, for some
Matcher implementations it might be useful to leave the choice to the
user, for others not.

Bye,
  Stefan

-- 
Stefan Heimann       | http://www.stefanheimann.net
Brandensteinstr. 5   | http://www.cantaloop.org
D-79110 Freiburg     | http://cvsshell.sourceforge.net

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message