[jdom-interest] detach() [eg]

Jason Hunter jhunter at collab.net
Sun Apr 29 14:32:40 PDT 2001


Brett McLaughlin wrote:
> 
> I still want to vocally say that I think detach() is not in line with the
> rest of the API; at least not on the element being detached. I still don't
> see why removeContent() is not fine. 

Because we don't have Document.removeContent(Element)!  So you can't use
the method for removing a root.

Why don't we have the method?  Because to do so opens up the same kettle
of fish about well-formedness.

You could propose we add Document.removeContent(Element) but to be
clear: that doesn't help us avoid the IllegalStateException condition.  

You could probably convince me to add Document.removeContent(Element)
but I'd want it to be in addition to the detach() method on Element
which I think is necessary to make moving objects simpler.  As I said in
my previous email, I don't like writing triple-case code block for a
simple move.  You could think of detach() as a convenience which you
could avoid if you so chose, just like method chaining.  :-)

-jh-



More information about the jdom-interest mailing list