[jdom-interest] detach() [eg]

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Apr 22 14:57:07 PDT 2001


At 11:05 AM -0400 4/22/01, Scott Means wrote:

>Just to add my $.02, I agree with Rusty. Throwing an exception is the right
>thing to do. The only minor modification I would suggest is that rather
>than adding a new method, the existing setRootElement() method be changed
>to:
>     Element setRootElement(Element rootElement)
>

Scott's right. Given that setRootElement() already exists there's no 
reason to add a new changeRootElement() method. However, I do think 
this method (and all other setter methods) should return void. Given 
that I've already lost that argument, I'd prefer consistency with the 
rest of the API and keep setRootElement() with the signature it has 
now rather than returning the detached old root element.

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list