[jdom-interest] Missing removeContent() methods

Alex Rosen arosen at silverstream.com
Thu May 2 10:06:36 PDT 2002


> By my reckoning the Element class is missing two
> removeContent() methods it should logically have:
>
> public boolean removeContent()
>
>   removes all content from the element

Use setContent(null) or setContent(new ArrayList()) instead.

>
> public boolean removeContent(List list)
>
>  removes everything in the list from the element

If we add a Node interface, you could just iterate over the list yourself.

> We do have equivalent versions of removeChildren() but these only
> operate on child elements, not all possible kinds of children.

I don't see removeChildren(List). There is a removeChildren(), though I
can't think of a reason that anyone would want to remove all child Elements
but keep all other content. Maybe this is ripe for removal? If someone
really wanted to do that they could just do it manually in a few lines of
code.

Hey, didn't we used to have a hasContent(), for efficiency? I see
hasChildren(), but not hasContent().

Alex




More information about the jdom-interest mailing list