[jdom-interest] Parameter ordering in canContain

Bradley S. Huffman hip at cs.okstate.edu
Wed Feb 18 10:27:06 PST 2004

Is there some reason the order of parameters in canContain is different
from every other JDOM method that takes a index?  And no other JDOM
method declares that it throws a RuntimeException so canContain shouldn't.

And what is the purpose of this method anyway, other than to save a instanceof
on content addition, which could have been accomplished by setting a boolean
"isElement" on ContentList construction? If it for notification of events, I'd
prefer XOM's methodology of checkAddChild/checkRemoveChild, checkAddAttribute/
checkRemoveChild, and so on.  Which don't contain any well-formness test, so
you cann't screw anything up by overriding them.


More information about the jdom-interest mailing list