Hi Dave

From: "David White" <[EMAIL PROTECTED]>
> > Shall we go for the following?
> >
> > public interface ElementHandler {
> >     public void onStart( ElementPath path );
> >     public void onEnd( ElementPath path );
> > }
> >
>
> That's what I have and I changed ElementStack to implement ElementPath.
> Do you think that this makes it ok to make ElementStack private again?

Yes! Lets do it.


> Yes, I did check out the files as me.

Cool - check in your work whenever you're ready.


> The only thing I think I should do is change SAXReader like this:
>
> Add the methods:
>
> public void addHandler(String path, ElementHandler handler) {
>   getDispatchHandler().addHandler(path, handler);
> }
> public void removeHandler(String path) {
>   getDispatchHandler().removeHandler(path);
> }
> setDefaultHandler(String path, ElementHandler handler) {
>   getDispatchHandler().setDefaultHandler(path, handler);
> }

Sounds good.



> Chage the methods:
>
> public ElementHandler getElementHandler();
> public void setElementHandler setElementHandler(ElementHandler handler);
>
> to
>
> public DispatchHandler getDispatchHandler();
> public void setDispatchHandler (DispatchHandler handler);

Though I was thinking of making getDispatchHandler() a lazily constructed
protected property.

I was thinking about having addElementHandler() and removeElementHandler()
that either took just an ElementHandler or could take a String path and an
ElementHandler and then hiding the use of the DispatchHandler. (Of course
users could use it too if they wish)

> and also (maybe???) get rid of the pruningElementHandler stuff,
> as the DispatchHandler can handle this case and others.
>
> How does that sound?

Sounds cool with me.

Am still thinking about the effects on pruning... Since its only one line of
code ("detach()"), maybe the user can do this....

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to