try {  Class c = this.getClass().getClassLoader().loadClass(clazz); handler = (Handler) c.newInstance(); currentHandlerManager.addHandler(handler); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (localName.equals(ELEMENT_HANDLERS)) { stack.add(currentHandlerManager); currentHandlerManager = (HandlerManager) handler; } }
if (localName.equals(ELEMENT_HANDLER)) { String clazz = atts.getValue(ATTRIBUTE_CLASS);  try {  Class c = this.getClass().getClassLoader().loadClass(clazz); handler = (Handler) c.newInstance(); currentHandlerManager.addHandler(handler); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } else if (localName.equals(ELEMENT_HANDLERS)) { stack.add(currentHandlerManager); currentHandlerManager = (HandlerManager) handler; } else if (localName.equals(ELEMENT_PARSER)) { String clazz = atts.getValue(ATTRIBUTE_CLASS); try {  Class c = this.getClass().getClassLoader().loadClass(clazz); this.parser = (Parser) c.newInstance(); if (this.parser instanceof HandlerManager) { this.currentHandlerManager = (HandlerManager) this.parser; } this.stack = new Stack(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); }  }  } }
    public void startElement(String namespaceURI, String localName,        String qName, Attributes atts) throws SAXException {        if (localName.equals(ELEMENT_HANDLER)) {            String clazz = atts.getValue(ATTRIBUTE_CLASS);            try {                // load the class and add to the currentHandlerManager                Class c = this.getClass().getClassLoader().loadClass(clazz);                handler = (Handler) c.newInstance();                currentHandlerManager.addHandler(handler);            } catch (ClassNotFoundException e) {                e.printStackTrace();            } catch (InstantiationException e) {                e.printStackTrace();            } catch (IllegalAccessException e) {                e.printStackTrace();            }        } else if (localName.equals(ELEMENT_HANDLERS)) {            stack.add(currentHandlerManager);            currentHandlerManager = (HandlerManager) handler;        }    }