Code example for DefaultHandler

        SAXParserFactoryImpl spf = new SAXParserFactoryImpl();
        SAXParser sp = spf.newSAXParser();
        DefaultHandler h = new DefaultHandler();
        /* First: let's verify that we get an exception for 
         * unresolved reference... 
        try { 
            sp.parse(new InputSource(new StringReader(XML)), h);
        } catch (SAXException e) {
            verifyException(e, "No such file or directory");
        // And then with dummy resolver; should work ok now 
        sp = spf.newSAXParser();
        sp.getXMLReader().setEntityResolver(new MyResolver("   "));
        h = new DefaultHandler();
Contextual code suggestions in your IDE  Get Codota for Java