KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > util > xslt > XSLTErrorListener


1 package de.webman.util.xslt;
2
3 import javax.xml.transform.ErrorListener JavaDoc;
4 import javax.xml.transform.TransformerException JavaDoc;
5 import org.apache.log4j.Category;
6
7 /**
8  * Implementierung des JAXP Error Listeners.
9  *
10  * @author $Author: alex $
11  * @version $Revision: 1.2 $
12  */

13 public class XSLTErrorListener
14     implements ErrorListener JavaDoc
15 {
16
17     // $Id: XSLTErrorListener.java,v 1.2 2001/11/06 12:25:40 alex Exp $
18

19     // Constants.
20

21     /**
22      * The warning message.
23      */

24     private static final String JavaDoc MESSAGE_WARNING = "Warning during XSL transformation: ";
25
26     /**
27      * The error message.
28      */

29     private static final String JavaDoc MESSAGE_ERROR = "Recoverable error during XSL transformation: ";
30
31     /**
32      * The fatal error message.
33      */

34     private static final String JavaDoc MESSAGE_FATAL_ERROR = "Non-recoverable error during XSL transformation: ";
35
36     /**
37      * The logging category.
38      */

39     private static Category cat = Category.getInstance(XSLTErrorListener.class);
40
41
42     // Implementation of 'javax.xml.transform.ErrorListener'.
43

44     /**
45      * Logs a warning.
46      *
47      * @param exception the warning information encapsulated in a
48      * transformer exception.
49      */

50     public void warning (TransformerException JavaDoc exception)
51     {
52         cat.warn(MESSAGE_WARNING + exception.toString(), exception);
53     }
54
55     /**
56      * Logs a recoverable error.
57      *
58      * @param exception the error information encapsulated in a
59      * transformer exception.
60      */

61     public void error (TransformerException JavaDoc exception)
62     {
63         cat.error(MESSAGE_ERROR + exception.toString(), exception);
64     }
65
66     /**
67      * Logs a non-recoverable error.
68      *
69      * @param exception the error information encapsulated in a
70      * transformer exception.
71      */

72     public void fatalError (TransformerException JavaDoc exception)
73     {
74         cat.error(MESSAGE_FATAL_ERROR + exception.toString(), exception);
75     }
76
77 }
78
Popular Tags