Code example for DefaultHandler

Methods: startDocument

0
    private int depth;
 
    @Override 
    public void startDocument() throws SAXException {
        this.handler = XMLDecoder.createHandler(this, this, null);
        this.handler.startDocument();
    } 
 
    @Override 
    public void endDocument() { 
        this.handler = null;
    } 
 
    @Override 
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        print('>', qName);
        if (this.depth > 0) {
            this.handler.startElement(uri, localName, qName, attributes);
        } else if (!TEST.equals(qName)) {
            throw new SAXException("unexpected element name: " + qName);
Experience pair programming with AI  Get Codota for Java