Code example for SAXParserFactory

Methods: newSAXParser

0
        qdox.addSourceTree(sourceDir);
    } 
 
    public void load(InputSource inputSource)
            throws ParserConfigurationException, SAXException, IOException { 
        SAXParser saxParser = saxParserFactory.newSAXParser();
        saxParser.parse(inputSource, new DefaultHandler() {
            @Override 
            public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
                if (localName.equals("factory")) {
                    String className = attributes.getValue("class");
                    try { 
                        addClass(className);
                    } catch (ClassNotFoundException e) {
                        throw new SAXException("Cannot find Matcher class : " + className);
                    } 
                } 
            } 
        }); 
    } 
Experience pair programming with AI  Get Codota for Java