[jdom-interest] setText() to replace children?

Alex Rosen arosen at silverstream.com
Tue Jul 10 07:48:35 PDT 2001


The only problem with all these proposals is the lack of symmetry. If you get
text by calling getText(), it's natural to set it via setText(), and if that's
not the name of the method, you have to go looking for it, and figure out if it
really does what you want it to do. Similarly for setContent() and
setChildren(). Whether that's a good enough reason to keep the current state of
things, I don't know. I really like the intuitiveness of setText(), though. In
the common case where you don't have mixed content, it feels a lot more
natural.

Alex




More information about the jdom-interest mailing list