00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALAN_PROBLEMLISTENERBASE_HEADER_GUARD) 00019 #define XALAN_PROBLEMLISTENERBASE_HEADER_GUARD 00020 00021 00022 00023 // Base include file. Must be first. 00024 #include "xalanc/PlatformSupport/PlatformSupportDefinitions.hpp" 00025 00026 00027 00028 #include "LocalMsgIndex.hpp" 00029 00030 00031 00032 XALAN_DECLARE_XERCES_CLASS(Locator) 00033 00034 00035 00036 XALAN_CPP_NAMESPACE_BEGIN 00037 00038 00039 00040 XALAN_USING_XERCES(Locator) 00041 00042 00043 class XalanDOMString; 00044 class XalanNode; 00045 class PrintWriter; 00046 00047 00048 00049 /** 00050 * This is the abstract class that is used when reporting a problem 00051 * some kind, that requires a message, an error or a warning. 00052 */ 00053 class XALAN_PLATFORMSUPPORT_EXPORT ProblemListenerBase 00054 { 00055 public: 00056 00057 // Sources of problem. The upper case versions 00058 // of these enums are deprecated. 00059 enum eSource { eXMLPARSER = 0, 00060 eXMLParser = 0, 00061 eXSLPROCESSOR = 1, 00062 eXSLTProcessor = 1, 00063 eXPATH = 2, 00064 eXPath = 2, 00065 eSourceCount }; 00066 00067 // A typedef for compatibility. 00068 typedef eSource eProblemSource; 00069 00070 // Severity of problem. The upper case versions 00071 // of these enums are deprecated. 00072 enum eClassification { eMESSAGE = 0, 00073 eMessage = 0, 00074 eWARNING = 1, 00075 eWarning = 1, 00076 eERROR = 2, 00077 eError = 2, 00078 eClassificationCount }; 00079 00080 ProblemListenerBase(); 00081 00082 virtual 00083 ~ProblemListenerBase(); 00084 00085 /** 00086 * Function that is called when a problem event occurs. 00087 * 00088 * @param source Either eXMLParser, eXSLProcessor, or eXPATH. 00089 * @param classification Either eMessage, eWarning, or eError. 00090 * @param locator The current Locator instance for the stylesheet. Maybe be a null pointer. 00091 * @param sourceNode The current source node, if any. 00092 * @param msg The error message. 00093 */ 00094 virtual void 00095 problem( 00096 eSource source, 00097 eClassification classification, 00098 const XalanDOMString& msg, 00099 const Locator* locator, 00100 const XalanNode* sourceNode) = 0; 00101 00102 /** 00103 * Function that is called when a problem event occurs. This version 00104 * assumes location information is already formatted into the message. 00105 * 00106 * @param source either eXMLPARSER, eXSLPROCESSOR, or eXPATH 00107 * @param classification either eMESSAGE, eERROR or eWARNING 00108 * @param msg string message explaining the problem. 00109 */ 00110 virtual void 00111 problem( 00112 eSource source, 00113 eClassification classification, 00114 const XalanDOMString& msg, 00115 const XalanNode* sourceNode) = 0; 00116 00117 /** 00118 * Function to format a problem call to a PrintWriter instance. 00119 * This is a bare-bones implementation that uses localized strings. 00120 * 00121 * @param pw The PrintWriter instance to use. 00122 * @param source Either eXMLParser, eXSLProcessor, or eXPATH. 00123 * @param classification Either eMessage, eWarning, or eError. 00124 * @param locator The current Locator instance for the stylesheet. Maybe be a null pointer. 00125 * @param sourceNode The current source node, if any. 00126 * @param msg The error message. 00127 */ 00128 static void 00129 defaultFormat( 00130 PrintWriter& pw, 00131 eSource source, 00132 eClassification classification, 00133 const XalanDOMString& msg, 00134 const Locator* locator, 00135 const XalanNode* sourceNode); 00136 00137 /** 00138 * Function to format a problem call to a PrintWriter instance. 00139 * This is a bare-bones implementation that uses localized strings. 00140 * 00141 * @param pw The PrintWriter instance to use. 00142 * @param source either eXMLPARSER, eXSLPROCESSOR, or eXPATH 00143 * @param classification either eMESSAGE, eERROR or eWARNING 00144 * @param msg string message explaining the problem. 00145 */ 00146 static void 00147 defaultFormat( 00148 PrintWriter& pw, 00149 eSource source, 00150 eClassification classification, 00151 const XalanDOMString& msg, 00152 const XalanNode* sourceNode); 00153 00154 protected: 00155 00156 static const XalanMessages::Codes s_messageCodes[eSourceCount][eClassificationCount]; 00157 }; 00158 00159 00160 00161 XALAN_CPP_NAMESPACE_END 00162 00163 00164 00165 #endif // XALAN_PROBLEMLISTENER_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|