[jdom-interest] getMixedContent -> getContent

guru at stinky.com guru at stinky.com
Thu Jun 28 15:30:22 PDT 2001

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?

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?

(...excluding Jason's "all children, recursively", which I think is
specious, since the default assumption, at least in java.util.List, is
that an iterator or accessor does not recurse.)

> Longer term, I wonder if there's some way we can add an overloaded 
> getContent() method that takes some sort of filter object as an 
> argument, so that users could pass in filters to get only comments, 
> only text nodes, only text nodes that weren't ignorable white space, 
> only elements in a certain namespace, etc.

I thought that was what FilterList was for. (going to be for) 

Alex Chaffee                       mailto:alex at jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

More information about the jdom-interest mailing list