Code example for DocumentBuilder

Methods: setErrorHandler

0
 
  public synchronized void releaseDocumentBuilder(DocumentBuilder documentBuilder)
  { 
    if (documentBuilder != null)
    { 
      documentBuilder.setErrorHandler
        (new ErrorHandler()
         { 
           public void error(SAXParseException exception) throws SAXException
           { 
             // Ignore. 
           } 
 
           public void fatalError(SAXParseException exception) throws SAXException
           { 
             // Ignore. 
           } 
 
           public void warning(SAXParseException exception) throws SAXException
           { 
             // Ignore. 
           } 
         }); 
      documentBuilderCache.add(documentBuilder);
    } 
  } 
 
  public synchronized SAXParser getSAXParser(LexicalHandler lexicalHandler) throws ParserConfigurationException, SAXException
  {