[jdom-interest] Additional JDOMException subclasses

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Apr 11 15:23:49 PDT 2002


Currently JDOMException covers a lot of ground. For example, both 
well-formedness and validity errors are reported just as "JDOMException" 
even though SAX can distinguish them. I suggest it would be useful to add a

ValidityException extends JDOMException

for use by SAXBuilder. Simple use-case: a utility program that checks 
documents for errors and reports them (about the third example in my 
JDOM tutorial) should be able to distinguish well-formedness and 
validity errors.

Are there any other more detailed exception classes anybody wants? For 
instance, should we also have a separate

MalformedException extends JDOMException

There are, after all, some JDOMExceptions that are neither 
well-formedness nor validity errors.

Let's discuss what we might want; and then, if we've got a rough 
consenseus, I'll take a whack at the code. Note that unlike my earlier 
exception patches for IOException these should be completely compatible 
with existing code. They should break anybody's programs.

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






More information about the jdom-interest mailing list