[jdom-interest] Text exception patch

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu May 16 14:44:15 PDT 2002


The attached patch adds @throws clauses for runtime exceptions thrown by 
the constructor, setText(), and appendText() methods in Text. It changes 
the JavaDoc only and does not touch the actual code.

This is the last patch of this nature for org.jdom unless someone 
notices an exception I missed. All the other classes (EntityRef, etc.) 
seem to correctly document their runtime exceptions.

-- 
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+ 
|           The XML Bible, 2nd Edition (IDG Books, 2001)             |
|             http://www.cafeconleche.org/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.cafeconleche.org/   |
+----------------------------------+---------------------------------+


-------------- next part --------------
Index: src/java/org/jdom/Text.java
===================================================================
RCS file: /home/cvspublic/jdom/src/java/org/jdom/Text.java,v
retrieving revision 1.14
diff -d -u -r1.14 Text.java
--- src/java/org/jdom/Text.java	2002/04/29 13:38:16	1.14
+++ src/java/org/jdom/Text.java	2002/05/17 05:49:08
@@ -98,6 +98,9 @@
      * supplied string value as it's character content.
      *
      * @param str the node's character content.
+     * @throws IllegalDataException if <code>str</code> contains an 
+     *         illegal character such as a vertical tab (as determined
+     *         by {@link org.jdom.Verifier#checkCharacterData})
      */
     public Text(String str) {
         setText(str);
@@ -175,6 +178,9 @@
      * This will set the value of this <code>Text</code> node.
      *
      * @param str value for node's content.
+     * @throws IllegalDataException if <code>str</code> contains an 
+     *         illegal character such as a vertical tab (as determined
+     *         by {@link org.jdom.Verifier#checkCharacterData})
      */
     public Text setText(String str) {
         String reason;
@@ -196,6 +202,9 @@
      * exists within this <code>Text</code> node.
      *
      * @param str character content to append.
+     * @throws IllegalDataException if <code>str</code> contains an 
+     *         illegal character such as a vertical tab (as determined
+     *         by {@link org.jdom.Verifier#checkCharacterData})
      */
     public void append(String str) {
         String reason;


More information about the jdom-interest mailing list