[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [xml-dev] [SAX] setProperty and exception
- From: "Robert C. Lyons" <boblyons@unidex.com>
- To: Kohsuke KAWAGUCHI <kohsukekawaguchi@yahoo.com>, xml-dev@lists.xml.org
- Date: Fri, 28 Sep 2001 20:20:59 -0400
Based on the following sentence in the description of
the org.xml.sax.SAXNotSupportedException class,
I believe that an XMLReader.setProperty method should
throw a SAXNotSupportedException when the property
name is recognized and supported, but the value is
invalid:
An XMLReader will throw this exception when it
recognizes a feature or property identifier, but
cannot perform the requested operation (setting
a state or value).
Hope this helps.
Bob
<sig name = 'Bob Lyons'
title = 'B2B Integration Consultant'
company = 'Unidex, Inc.'
phone = '+1-732-975-9877'
email = 'boblyons@unidex.com'
url = 'http://www.unidex.com/'
product = 'XML Convert: transforms flat files to XML and vice versa' />
-----Original Message-----
XMLReader#setProperty can throw two types of exceptions. One is
"not-recognized" and the other is "not-supported".
But it seems to me that we need the third "bad-value" exception, which
indicates that the property name is recognized and supported but the
specified value is wrong. (For example, String is passed where Integer
is expected, or 127 was passed where the valid value is between 0 and
100.)
What is the right exception to throw for cases like this?
regards,
----------------------
K.Kawaguchi
E-Mail: kohsukekawaguchi@yahoo.com