KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > ejb > cmp3 > xml > parser > XMLExceptionHandler


1 package oracle.toplink.essentials.internal.ejb.cmp3.xml.parser;
2
3 import org.xml.sax.ErrorHandler JavaDoc;
4 import org.xml.sax.SAXException JavaDoc;
5 import org.xml.sax.SAXParseException JavaDoc;
6
7 public class XMLExceptionHandler implements ErrorHandler JavaDoc {
8     private XMLException m_xmlException;
9
10     public void warning(SAXParseException JavaDoc exception) throws SAXException JavaDoc {
11         this.error(exception);
12     }
13
14     public void error(SAXParseException JavaDoc exception) throws SAXException JavaDoc {
15         if (m_xmlException == null) {
16             m_xmlException = new XMLException();
17         }
18         m_xmlException.addNestedException(exception);
19     }
20
21     public void fatalError(SAXParseException JavaDoc exception) throws SAXException JavaDoc {
22         this.error(exception);
23     }
24     
25     public XMLException getXMLException() {
26         return m_xmlException;
27     }
28 }
29
Popular Tags