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

Jason Hunter jhunter at xquery.com
Wed Feb 11 17:50:09 PST 2004


Elliotte Rusty Harold wrote:

> 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. 

The idea has some merit.  Parent would be an interface, Node would be an 
abstract class implemented by all nodes.

> Except for setParent, all of the Node methods 
> make sense for Document, 

detach() and getParent() don't make much sense either.  Put another way, 
the only method from Content that might make any sense is getValue(), 
and there not much.

> and setParent is protected. Hmm, why is 
> setParent exposed at all? Shoudln't parentage be determined by adding 
> the child to the parent?

It's protected so subclasses can do interesting things like IdElement 
does in jdom-contrib.

-jh-




More information about the jdom-interest mailing list