[jdom-interest] Re: Comments on JDOM b10-rc1

Bradley S. Huffman hip at cs.okstate.edu
Wed Feb 11 17:50:32 PST 2004


Elliotte Rusty Harold writes:

> At 12:04 PM -0800 2/11/04, Jason Hunter wrote:
> 
> >Well, Node would work (and Parent/Node is a better split than 
> >Parent/Content) but if Document is not a Node that breaks the notion 
> >of Node.
> 
> Document should be a Node. Except for setParent, all of the Node 
> methods make sense for Document, and setParent is protected. Hmm, why 
> is setParent exposed at all? Shoudln't parentage be determined by 
> adding the child to the parent?

Why? A Document never has a parent. It doesn't have a owning document,
unless you want to say it is it's own owning document? It doesn't have a
XPath value. You cann't add or detach it from anything.  None of Element's
methods that return a List will ever contain a Document.  So what advantage
is there to it being a Node/Child/Content?

Brad



More information about the jdom-interest mailing list