OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   SAXException, checked, buy why?

[ Lists Home | Date Index | Thread Index ]
  • To: xml-dev@lists.xml.org
  • Subject: SAXException, checked, buy why?
  • From: Alan Gutierrez <alan-xml-dev@engrm.com>
  • Date: Sat, 1 Jan 2005 19:42:20 -0500
  • Mail-followup-to: xml-dev@lists.xml.org
  • User-agent: Mutt/1.4.1i

    What was the thinking behind making SAXException a checked
    exception?
   
    I'm considering removing them from my SAX Strategy library, and
    attempting to replace them with an error handling interface that
    throws unchecked exceptions of the user's choice.

    It would allow me to do things like:

    Composer composer = new Composer();

    Composer map = composer.launch("map", new PairedEventListener() {
        public void start(Campaign campaign, Event event) {
            campaign.getSink()
                    .getSpigot()
                    .startAttributes(event.getElement())
                        .attribute("extra-attribute", 1)
                    .startElement(event.getElement());
        }
        public void end(Campaign campaign, Event event) {
            event.getElement().forward(campaign.getSink())
        }
    }

    When I'm writing a lot of little anonymous classes, the method
    signature gets cumbersome, and I can see that I'm only
    propigating the exception.

    It's unslightly. If it's simply a matter of taste, I think I
    might make it more inline with my taste.

    Kind regards.

--
Alan Gutierrez - alan@engrm.com




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS