1 | /*
|
---|
2 | * Copyright 1999-2000,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Log: PSVIHandler.hpp,v $
|
---|
19 | * Revision 1.10 2004/09/23 21:22:15 peiyongz
|
---|
20 | * Documentation
|
---|
21 | *
|
---|
22 | * Revision 1.9 2004/09/22 20:38:45 peiyongz
|
---|
23 | * provide default implementation and documentation
|
---|
24 | *
|
---|
25 | * Revision 1.8 2004/09/21 16:09:37 peiyongz
|
---|
26 | * Handle partial PSVIElement
|
---|
27 | *
|
---|
28 | * Revision 1.7 2004/09/08 13:56:07 peiyongz
|
---|
29 | * Apache License Version 2.0
|
---|
30 | *
|
---|
31 | * Revision 1.6 2003/12/01 23:23:26 neilg
|
---|
32 | * fix for bug 25118; thanks to Jeroen Witmond
|
---|
33 | *
|
---|
34 | * Revision 1.5 2003/11/28 05:13:45 neilg
|
---|
35 | * remove passing of prefixes in PSVIHandler
|
---|
36 | *
|
---|
37 | * Revision 1.4 2003/11/25 14:20:21 neilg
|
---|
38 | * clean up usage of const in PSVIHandler
|
---|
39 | *
|
---|
40 | * Revision 1.3 2003/11/17 18:12:00 neilg
|
---|
41 | * PSVIAttributeList needs to be included by PSVIHandler. Thanks to Pete Lloyd for the patch
|
---|
42 | *
|
---|
43 | * Revision 1.2 2003/09/22 15:03:06 neilg
|
---|
44 | * clearly the local name of an element should be a string, not an XMLElementDecl...
|
---|
45 | *
|
---|
46 | * Revision 1.1 2003/09/16 14:33:36 neilg
|
---|
47 | * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
|
---|
48 | *
|
---|
49 | */
|
---|
50 |
|
---|
51 |
|
---|
52 | #if !defined(PSVIHANDLER_HPP)
|
---|
53 | #define PSVIHANDLER_HPP
|
---|
54 |
|
---|
55 | #include <xercesc/framework/psvi/PSVIElement.hpp>
|
---|
56 | #include <xercesc/framework/psvi/PSVIAttributeList.hpp>
|
---|
57 |
|
---|
58 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
59 |
|
---|
60 |
|
---|
61 | /**
|
---|
62 | * This abstract class provides the interface for the scanner to return
|
---|
63 | * PSVI information to the application.
|
---|
64 | *
|
---|
65 | */
|
---|
66 | class XMLPARSER_EXPORT PSVIHandler
|
---|
67 | {
|
---|
68 | public:
|
---|
69 | // -----------------------------------------------------------------------
|
---|
70 | // Constructors are hidden, just the virtual destructor is exposed
|
---|
71 | // -----------------------------------------------------------------------
|
---|
72 | /** @name Destructor */
|
---|
73 | //@{
|
---|
74 | virtual ~PSVIHandler()
|
---|
75 | {
|
---|
76 | }
|
---|
77 | //@}
|
---|
78 |
|
---|
79 | /** @name The PSVI handler interface */
|
---|
80 | //@{
|
---|
81 | /** Receive notification of the PSVI properties of an element.
|
---|
82 | * The scanner will issue this call after the XMLDocumentHandler
|
---|
83 | * endElement call. Since the scanner will issue the psviAttributes
|
---|
84 | * call immediately after reading the start tag of an element, all element
|
---|
85 | * content will be effectively bracketed by these two calls.
|
---|
86 | * @param localName The name of the element whose end tag was just
|
---|
87 | * parsed.
|
---|
88 | * @param uri The namespace to which the element is bound
|
---|
89 | * @param elementInfo Object containing the element's PSVI properties
|
---|
90 | */
|
---|
91 | virtual void handleElementPSVI
|
---|
92 | (
|
---|
93 | const XMLCh* const localName
|
---|
94 | , const XMLCh* const uri
|
---|
95 | , PSVIElement * elementInfo
|
---|
96 | ) = 0;
|
---|
97 |
|
---|
98 | /**
|
---|
99 | * Receive notification of partial PSVI properties of an element.
|
---|
100 | * This callback is made right after the psviAttributes
|
---|
101 | * call for non-empty element.
|
---|
102 | *
|
---|
103 | * The PSVIElement passed in has all fields properly set and it
|
---|
104 | * can be safely accessed the same way as the one passed in handleElementPSVI.
|
---|
105 | * However, fields listed below always have default values.
|
---|
106 | *
|
---|
107 | * getValidity() PSVIItem::VALIDITY_NOTKNOWN
|
---|
108 | * getValidationAttemped() PSVIItem::VALIDATION_NONE
|
---|
109 | * getMemberTypeDefinition() 0
|
---|
110 | * getSchemaNormalizedValue() 0
|
---|
111 | * getCanonicalRepresentation() 0
|
---|
112 | * getNotationDeclaration() 0
|
---|
113 | *
|
---|
114 | *
|
---|
115 | * @param localName The name of the element upon which start tag
|
---|
116 | * these attributes were encountered.
|
---|
117 | * @param uri The namespace to which the element is bound
|
---|
118 | * @param elementInfo Object containing the element's partial PSVI properties
|
---|
119 | */
|
---|
120 | virtual void handlePartialElementPSVI
|
---|
121 | (
|
---|
122 | const XMLCh* const localName
|
---|
123 | , const XMLCh* const uri
|
---|
124 | , PSVIElement * elementInfo
|
---|
125 | )
|
---|
126 | { }
|
---|
127 |
|
---|
128 | /**
|
---|
129 | * Enables PSVI information about attributes to be passed back to the
|
---|
130 | * application. This callback will be made on *all*
|
---|
131 | * elements; on elements with no attributes, the final parameter will
|
---|
132 | * be null.
|
---|
133 | * @param localName The name of the element upon which start tag
|
---|
134 | * these attributes were encountered.
|
---|
135 | * @param uri The namespace to which the element is bound
|
---|
136 | * @param psviAttributes Object containing the attributes' PSVI properties
|
---|
137 | * with information to identify them.
|
---|
138 | */
|
---|
139 | virtual void handleAttributesPSVI
|
---|
140 | (
|
---|
141 | const XMLCh* const localName
|
---|
142 | , const XMLCh* const uri
|
---|
143 | , PSVIAttributeList * psviAttributes
|
---|
144 | ) = 0;
|
---|
145 |
|
---|
146 |
|
---|
147 | //@}
|
---|
148 |
|
---|
149 |
|
---|
150 |
|
---|
151 | protected :
|
---|
152 | // -----------------------------------------------------------------------
|
---|
153 | // Hidden Constructors
|
---|
154 | // -----------------------------------------------------------------------
|
---|
155 | PSVIHandler()
|
---|
156 | {
|
---|
157 | }
|
---|
158 |
|
---|
159 |
|
---|
160 | private:
|
---|
161 | // -----------------------------------------------------------------------
|
---|
162 | // Unimplemented constructors and operators
|
---|
163 | // -----------------------------------------------------------------------
|
---|
164 | PSVIHandler(const PSVIHandler&);
|
---|
165 | PSVIHandler& operator=(const PSVIHandler&);
|
---|
166 | };
|
---|
167 |
|
---|
168 | XERCES_CPP_NAMESPACE_END
|
---|
169 |
|
---|
170 | #endif
|
---|