[jdom-interest] Text class (Modified)

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon May 28 06:00:28 PDT 2001


At 4:42 PM -0500 5/27/01, Brett McLaughlin wrote:
>OK. So now we're at:
>
>public class Text {

>     public Text(String stringValue) {
>         value = new StringBuffer(stringValue);
>     }

What should we do if stringValue is null? I suggest throwing an 
immediate NullPointerException.

What should we do if stringValue is empty? Does it make sense to 
allow an empty text node?


>     public void setValue(String stringValue) {
>         value = new StringBuffer(stringValue);
>     }
>

Ditto.

>     public void append(String stringValue) {
>         value.append(stringValue);
>     }
>

Ditto.


-- 

+-----------------------+------------------------+-------------------+
| 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