[jdom-interest] getChildTextNormalize()

Kent C. Johnson kentyman23 at hotmail.com
Tue Oct 2 08:43:25 PDT 2001

Alex (and All),

Agreed about the trimText(), it was just a thought.

I too agree it's bad to have methods in a parent that merely call methods in 
a child.  However, there is something to be said for the null-checking 
getChildText() does.  Since it doesn't just call getChild().getText(), it 
can be said that it has it's own functionality, namely returning "" if 
getChild() == null, and if not, returning the wrap of getChild().getText().  
Sounds a lot like a loop-hole too keep it in, but that may be a good thing.  
I think if everyone wanted the EXACT right OOP way to do things, they might 
lean more towards DOM.  But it seems to me (through my occasional use) that 
JDOM is more about convenience.  Not convenience to the point of excessive 
clutter, but a happy medium.

Do you agree?

Regards, and sorry to open this "Pandora's Box" as Jason called it, :)

>From: "Alex Rosen" <arosen at silverstream.com>
>To: "'Kent C. Johnson'" <kentyman23 at hotmail.com>, <jdom-interest at jdom.org>
>Subject: RE: [jdom-interest] getChildTextNormalize()
>Date: Tue, 2 Oct 2001 10:57:43 -0400
>I could live with any of this either way. I agree that consistency is a 
>thing, but I'm not sure I see the value of a trimText() that just calls
>String.trim(). philip.nelson (Phil?) didn't seem to like the idea of
>getChildText() because it's mixing levels inappropriately. I tend to agree,
>but I don't feel very strongly about it.

Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

More information about the jdom-interest mailing list