[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: SAXException, checked, buy why?
  • From: Alan Gutierrez <alan-xml-dev@e...>
  • Date: Sat, 1 Jan 2005 19:42:20 -0500
  • Mail-followup-to: xml-dev@l...
  • 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@e...

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member