[jdom-interest] getMixedContent -> getContent

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Jun 28 18:12:40 PDT 2001


At 3:30 PM -0700 6/28/01, guru at stinky.com wrote:
>On Thu, Jun 28, 2001 at 10:50:47AM -0400, Elliotte Rusty Harold wrote:
>>  I wanted to weigh in on this. I just looked through the JavaDocs, and
>>  it seems very clear to me that getChild should be renamed
>>  getChildElement(), getChildren() should be renamed
>>  getChildElements(), and so forth through the API. The current API is
>>  way too confusing on this point.
>
>Are you saying that getChildren alone implies that it will return
>other node types than Elements?
>

Yes, absolutely.

>If so, then why not go all the way?  I'd prefer getElements() over
>getChildElements().  What other elements, other than child elements,
>would element.getElements() possibly return?
>

I think getChildElements() is clearer. We could be talking about 
ancestor, sibling, descendant, or various other subgroups of 
elements. getChildElements() just makes more sense. PLus it will show 
up in the right place in the docs when someone goes looking for 
getChildren() method.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list