Xalan-C++ API Reference  1.12.0
ProblemListenerDefault.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_PROBLEMLISTENERDEFAULT_HEADER_GUARD)
19 #define XALAN_PROBLEMLISTENERDEFAULT_HEADER_GUARD
20 
21 
22 
23 // Base include file. Must be first.
24 #include "XSLTDefinitions.hpp"
25 
26 
27 
28 // Xalan header files.
30 
31 
32 
33 namespace XERCES_CPP_NAMESPACE
34 {
35  class MemoryManager;
36 }
37 
38 
39 
40 namespace XALAN_CPP_NAMESPACE {
41 
42 
43 
44 using xercesc::MemoryManager;
45 
46 
47 
48 /**
49  * The implementation of the default error handling for Xalan.
50  */
52 {
53 public:
54 
56  MemoryManager& theManager,
57  PrintWriter* pw = 0);
58 
59  virtual
61 
62 
63  // These methods are inherited from ProblemListener ...
64 
65  virtual void
66  setPrintWriter(PrintWriter* pw);
67 
68  virtual void
69  problem(
70  eSource source,
71  eClassification classification,
72  const XalanDOMString& msg,
73  const Locator* locator,
74  const XalanNode* sourceNode);
75 
76  virtual void
77  problem(
78  eSource source,
79  eClassification classification,
80  const XalanDOMString& msg,
81  const XalanNode* sourceNode);
82 
83  virtual void
84  problem(
85  eSource source,
86  eClassification classification,
87  const XalanNode* sourceNode,
88  const ElemTemplateElement* styleNode,
89  const XalanDOMString& msg,
90  const XalanDOMChar* uri,
91  XalanFileLoc lineNo,
92  XalanFileLoc charOffset);
93 
94  // These methods are new...
95 
98  {
99  return m_pw;
100  }
101 
102  static void
104  PrintWriter& pw,
105  eSource source,
106  eClassification classification,
107  const XalanDOMString& msg,
108  const Locator* locator,
109  const XalanNode* sourceNode)
110  {
111  ProblemListenerBase::defaultFormat(
112  pw,
113  source,
114  classification,
115  msg,
116  locator,
117  sourceNode);
118  }
119 
120  static void
122  PrintWriter& pw,
123  eSource source,
124  eClassification classification,
125  const XalanDOMString& msg,
126  const XalanNode* sourceNode)
127  {
128  ProblemListenerBase::defaultFormat(
129  pw,
130  source,
131  classification,
132  msg,
133  sourceNode);
134  }
135 
136  static void
137  defaultFormat(
138  PrintWriter& pw,
139  eSource source,
140  eClassification classification,
141  const XalanNode* sourceNode,
142  const ElemTemplateElement* styleNode,
143  const XalanDOMString& msg,
144  const XalanDOMChar* uri,
145  XalanFileLoc lineNo,
146  XalanFileLoc charOffset);
147 
148 private:
149 
150  MemoryManager& m_memoryManager;
151 
152  PrintWriter* m_pw;
153 };
154 
155 
156 
157 }
158 
159 
160 
161 #endif // XALAN_PROBLEMLISTENERDEFAULT_HEADER_GUARD
xalanc::ProblemListenerDefault::defaultFormat
static void defaultFormat(PrintWriter &pw, eSource source, eClassification classification, const XalanDOMString &msg, const Locator *locator, const XalanNode *sourceNode)
Definition: ProblemListenerDefault.hpp:103
xalanc::ProblemListenerDefault::defaultFormat
static void defaultFormat(PrintWriter &pw, eSource source, eClassification classification, const XalanDOMString &msg, const XalanNode *sourceNode)
Definition: ProblemListenerDefault.hpp:121
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanNode
Definition: XalanNode.hpp:38
ProblemListener.hpp
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::ElemTemplateElement
Definition: ElemTemplateElement.hpp:79
xalanc::ProblemListenerBase::eSource
eSource
Definition: ProblemListenerBase.hpp:62
xalanc::ProblemListenerDefault::getPrintWriter
PrintWriter * getPrintWriter() const
Definition: ProblemListenerDefault.hpp:97
xalanc::ProblemListener
This is the abstract class that the XSL processor uses when it has a problem of some kind,...
Definition: ProblemListener.hpp:48
xalanc::ProblemListenerDefault
The implementation of the default error handling for Xalan.
Definition: ProblemListenerDefault.hpp:51
xalanc::PrintWriter
Definition: PrintWriter.hpp:37
xalanc::ProblemListenerBase::eClassification
eClassification
Definition: ProblemListenerBase.hpp:75
XSLTDefinitions.hpp
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45