[jdom-interest] API inconsistency

Kenworthy, Edward edward.kenworthy at exchange.co.uk
Fri Jun 22 01:09:21 PDT 2001

I don't think it makes sense to have a getDocument on the attribute either.
(Nor a getElement which makes more sense).

-----Original Message-----
From: Jason Hunter [mailto:jhunter at collab.net]
Sent: 22 June 2001 08:05
To: Brett McLaughlin
Cc: JDOM Interest List
Subject: Re: [jdom-interest] API inconsistency

Brett McLaughlin wrote:
> In documenting the API for the 2nd edition of my book, I've noticed
> inconsistencies. Like, some constructs have setParent() and some don't.
> have getDocument(), some don't. 

Nothing that should have a setParent() is lacking one.  CDATA doesn't
have such a method because it's immutable and might exist at multiple
location in the tree.  DocType and and Document don't have it because
they don't have parents.

I see Attribute was missing a getDocument() but that's the only case.  I
added the method.  Thinking about it more, I'm not sure it belongs.  I
can't imagine why anyone would call attr.getDocument().  Let me know
what people think.

To control your jdom-interest membership:

More information about the jdom-interest mailing list