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

Elliotte Rusty Harold elharo at metalab.unc.edu
Tue Jul 10 09:52:06 PDT 2001


At 8:50 AM -0700 7/10/01, Alex Chaffee wrote:


>In fact, it opens the door to a new set of polymorphic methods, just like with addContent:
>
>  Element setContent(Comment comment)
>  Element setContent(Element element)
>  Element setContent(EntityRef entity)
>  Element setContent(ProcessingInstruction pi)
>  Element setContent(String text)
>
>to go with
>
> Element setContent(List content)
>

These aren't wrong, but I don't see a lot of need for them. How often do you need to set the content of an element to a processing instruction anyway? I'd prefer not to clutter the API and just have the two setContent methods, one for lists and one for strings. 
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      | 
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list