01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.desktop.dp.xml;
06:
07: import java.util.logging.Level;
08: import java.util.logging.Logger;
09:
10: import org.xml.sax.ErrorHandler;
11: import org.xml.sax.SAXParseException;
12: import org.xml.sax.SAXException;
13:
14: import com.sun.portal.desktop.dp.DPError;
15:
16: import com.sun.portal.desktop.context.DPContext;
17: import com.sun.portal.log.common.PortalLogger;
18:
19: public class XMLDPErrorHandler implements ErrorHandler {
20: protected DPContext context = null;
21: private static Logger logger = PortalLogger
22: .getLogger(XMLDPErrorHandler.class);
23:
24: public XMLDPErrorHandler(DPContext context) {
25: if (context == null) {
26: throw new DPError(
27: "XMLDPErrorHandler.XMLDPErrorHandler(): context was null");
28: }
29:
30: this .context = context;
31: }
32:
33: public void error(SAXParseException e) throws SAXParseException {
34: throw e;
35: }
36:
37: public void fatalError(SAXParseException e)
38: throws SAXParseException {
39: throw e;
40: }
41:
42: public void warning(SAXParseException e) {
43: if (logger.isLoggable(Level.WARNING))
44: logger.log(Level.WARNING, "PSDT_CSPDDX0001", e);
45: }
46: }
|