[jdom-interest] getChild() convenience methods

Bradley S. Huffman hip at csa.cs.okstate.edu
Fri May 30 07:10:04 PDT 2003


"Bill Woodward" writes:

> Bradley S. Huffman said:
> >
> > The now deprecated getChildren/getChild methods where always a bit
> > confusing since DOM uses "children" to mean all mixed content, i.e.
> > elements, comments, text, pi, and so forth, and JDOM had getChildren return
> > a list of only elements. Consequently users would use getChildren to get a
> > list and then wonder where all they text nodes or other nodes went. Hence
> > the name change to getChildElement/getChildElements to empathize that they
> > always return elements.
> >
> 
> So what do the convenience methods become?
> 
> getChildText() --> getChildElementText()
> getChildTextNormalize() --> getChildElementTextNormalize()
> getChildTextTrim() --> getChildElementTextTrim()

They stay the same, since they return a string of text representing the 
value of the child Text nodes concatenated together it doesn't make sense
to have Element in the name.

Brad



More information about the jdom-interest mailing list