[jdom-interest] insertChild in Element

Jason Hunter jhunter at collab.net
Wed Aug 30 09:31:32 PDT 2000


> It seems to me that the ability to insert a child into an 
> Element at a particular location is behavior which belongs to the 
> Element itself.  I
> would advocate adding this capability to Element.

Then you need the ability to remove a particular child by index too. 
And the ability to remove all children, remove a child by name, remove
all children with a name, add a set of children, remove a set of
children, and so on.

All these things are easily done with the List returned by getChildren()
using standard Java APIs.  I think it's better to give people access to
the List for them to manipulate as they like than reproduce all the List
functionality in Element.

-jh-



More information about the jdom-interest mailing list