[jdom-interest] SAXBuilder and Piccolo

Martin Schulz schulz at videotron.ca
Sun Nov 24 19:16:06 PST 2002


After thinking this through, I suggest to replace in
SAXBuilder.createParser():

                Class parserClass = jaxpParser.getClass();
                Method getXMLReader = 
	                parserClass.getMethod("getXMLReader", null);

with the more appropriate:

                Method getXMLReader = 
	
Class.forName("javax.xml.parsers.SAXParser").getMethod("getXMLReader",
null);

The reason is that parserClass needlessly refers to the implementing
class of the SAXParser, whereas non-reflecting
code such as
	parser = factory.newSAXParser().getXMLReader();
would only access the implementing class via the SAXParser interface.
The implementing class may be unaccessible (as is the case with
Piccolo).

	Martin

-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
On Behalf Of Jason Hunter
Sent: November 15, 2002 4:24 PM
To: Martin Schulz
Cc: jdom-interest at jdom.org; yuval at bluecast.com
Subject: Re: [jdom-interest] SAXBuilder and Piccolo


> Shouldn't the inner class JAXPSAXParser be declared public (if I do 
> that, it works for me), and why hasn't this been noted before?

Seems like it, but it's an internal class to Piccolo, so you may want to
ask them.  Perhaps they aren't anticipating such usage.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 04/09/2002
 




More information about the jdom-interest mailing list