On Dec 14, 2007, at 16:05, Vincent Hennebert wrote:

<snip />
But the test inside the loop is not necessary, since it will
automatically be performed at the end of the loop (more precisely:
before starting the next iteration). If ancestor is a Flow, then
ancestor is not a Wrapper, then the while loop will stop there. So the
following should be enough:
    while (ancestor instanceof Wrapper) {
        ancestor = ancestor.getParent();
    // Once we get here we have !(ancestor instanceof Wrapper)

Raaah!! My table is glass, so I think I'll skip the head-banging part for now... ;-)

You're right. I'll correct it.

* increase the general visibility to public (not sure why this would be
desirable; unless there's any other compelling reasons to do so, I'd
rather not...)

Yeah, we’re hitting a limitation of Java here. Basically we’re missing
a keyword allowing classes of a sub-package to access the method. Making
it public with a proper comment is still the less ugly way to do in my

I'll go for this one, then. Although it struck me that there is something awkward about the validateChildNode() method.

The question that triggered this: What if I wanted to implement an extension element that is a valid child to an fo:wrapper?

IIC, I would need to alter the hardcoded validateChildNode() in Wrapper.java to get FOP to not throw a ValidationException...

Maybe we need different validateChildFONode() and validateChildExtensionNode() methods. The first can be completely hardcoded for all I care (only changes when the recommendation changes), while the second one uses a sort of Map that can be extended by the users.



Reply via email to