Hi Laurent
That sounds a reasonable idea - I just wondered what if you need multiple
context objects or better typesafety.
e.g. consider
<foo id="1">
<bar id="4">
<foo id="2">
<bar id="5">
...
where you want to know the parent foo and bar. Another way to tackle the
problem could be for the ElementHandler objects communicate directly, or
communicate with some other intermediate object. e.g. you could have a
public interface FooBarContext {
public Foo getFoo();
public void setFoo(Foo foo);
public Bar getBar();
public void setBar(Bar bar);
}
then
final FooBarContext context = ...
PatternHandler ph = new PatternHandler();
ph.add(
"foo"
new ElementHandler() {
public void onStart( ElementPath ep ) {
Element element = ep.getCurrent();
Foo foo = context.getFoo();
...
}
);
It just seems that explicit communication by ElementHandler implementations
using some context object would be a bit cleaner and more typesafe. What do
you think?
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
dom4j-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-dev