Code example for SAXParseException

Methods: toString

0
 
    @Override 
    public void error(SAXParseException arg0) throws SAXException
    { 
      errors++;
      list.add(arg0.toString());
    } 
 
    @Override 
    public void fatalError(SAXParseException arg0) throws SAXException
    { 
      Assert.assertEquals(arg0.toString(), 1, 0);
    } 
 
    public int getErrors() 
    { 
      // one error message does not count since we are reporting dummy  
      // error for root declaration not found 
      return errors - 1;
    }