Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


ProblemListenerBase.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALAN_PROBLEMLISTENERBASE_HEADER_GUARD)
19 #define XALAN_PROBLEMLISTENERBASE_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
28 #include "LocalMsgIndex.hpp"
29 
30 
31 
32 XALAN_DECLARE_XERCES_CLASS(Locator)
33 
34 
35 
36 XALAN_CPP_NAMESPACE_BEGIN
37 
38 
39 
40 XALAN_USING_XERCES(Locator)
41 
42 
43 class XalanDOMString;
44 class XalanNode;
45 class PrintWriter;
46 
47 
48 
49 /**
50  * This is the abstract class that is used when reporting a problem
51  * some kind, that requires a message, an error or a warning.
52  */
54 {
55 public:
56 
57  // Sources of problem. The upper case versions
58  // of these enums are deprecated.
59  enum eSource { eXMLPARSER = 0,
60  eXMLParser = 0,
61  eXSLPROCESSOR = 1,
62  eXSLTProcessor = 1,
63  eXPATH = 2,
64  eXPath = 2,
65  eSourceCount };
66 
67  // A typedef for compatibility.
69 
70  // Severity of problem. The upper case versions
71  // of these enums are deprecated.
72  enum eClassification { eMESSAGE = 0,
73  eMessage = 0,
74  eWARNING = 1,
75  eWarning = 1,
76  eERROR = 2,
77  eError = 2,
78  eClassificationCount };
79 
81 
82  virtual
84 
85  /**
86  * Function that is called when a problem event occurs.
87  *
88  * @param source Either eXMLParser, eXSLProcessor, or eXPATH.
89  * @param classification Either eMessage, eWarning, or eError.
90  * @param locator The current Locator instance for the stylesheet. Maybe be a null pointer.
91  * @param sourceNode The current source node, if any.
92  * @param msg The error message.
93  */
94  virtual void
95  problem(
96  eSource source,
97  eClassification classification,
98  const XalanDOMString& msg,
99  const Locator* locator,
100  const XalanNode* sourceNode) = 0;
101 
102  /**
103  * Function that is called when a problem event occurs. This version
104  * assumes location information is already formatted into the message.
105  *
106  * @param source either eXMLPARSER, eXSLPROCESSOR, or eXPATH
107  * @param classification either eMESSAGE, eERROR or eWARNING
108  * @param msg string message explaining the problem.
109  */
110  virtual void
111  problem(
112  eSource source,
113  eClassification classification,
114  const XalanDOMString& msg,
115  const XalanNode* sourceNode) = 0;
116 
117  /**
118  * Function to format a problem call to a PrintWriter instance.
119  * This is a bare-bones implementation that uses localized strings.
120  *
121  * @param pw The PrintWriter instance to use.
122  * @param source Either eXMLParser, eXSLProcessor, or eXPATH.
123  * @param classification Either eMessage, eWarning, or eError.
124  * @param locator The current Locator instance for the stylesheet. Maybe be a null pointer.
125  * @param sourceNode The current source node, if any.
126  * @param msg The error message.
127  */
128  static void
129  defaultFormat(
130  PrintWriter& pw,
131  eSource source,
132  eClassification classification,
133  const XalanDOMString& msg,
134  const Locator* locator,
135  const XalanNode* sourceNode);
136 
137  /**
138  * Function to format a problem call to a PrintWriter instance.
139  * This is a bare-bones implementation that uses localized strings.
140  *
141  * @param pw The PrintWriter instance to use.
142  * @param source either eXMLPARSER, eXSLPROCESSOR, or eXPATH
143  * @param classification either eMESSAGE, eERROR or eWARNING
144  * @param msg string message explaining the problem.
145  */
146  static void
147  defaultFormat(
148  PrintWriter& pw,
149  eSource source,
150  eClassification classification,
151  const XalanDOMString& msg,
152  const XalanNode* sourceNode);
153 
154 protected:
155 
156  static const XalanMessages::Codes s_messageCodes[eSourceCount][eClassificationCount];
157 };
158 
159 
160 
161 XALAN_CPP_NAMESPACE_END
162 
163 
164 
165 #endif // XALAN_PROBLEMLISTENER_HEADER_GUARD
This is the abstract class that is used when reporting a problem some kind, that requires a message...
#define XALAN_PLATFORMSUPPORT_EXPORT
XALAN_CPP_NAMESPACE_BEGIN XALAN_USING_XERCES(Locator)

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo