[jdom-interest] API inconsistency

Jason Hunter jhunter at collab.net
Fri Jun 22 00:05:13 PDT 2001


Brett McLaughlin wrote:
> 
> In documenting the API for the 2nd edition of my book, I've noticed several
> inconsistencies. Like, some constructs have setParent() and some don't. Some
> 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.

-jh-



More information about the jdom-interest mailing list