Code example for SAXParseException

0
        if (qName.equals("secret")) {
            String className = attributes.getValue("class");
            try { 
                currSecret = (Secret) Class.forName(className).newInstance();
            } catch (Exception ex) {
                throw new SAXParseException(ex.getMessage(), null);
            } 
        } else if (!qName.equals("secretlist")) {
            currSecret.processStartElement(qName, attributes);
        } 
    } 
 
    public void endElement(String uri, String name, String qName)
        throws SAXParseException { 
 
        if (qName.equals("secret")) {
            secretList.add(currSecret);
            currSecret = null;
        } else if (!qName.equals("secretlist")) {
            currSecret.processEndElement(qName);
        }