Xerces-C++ 3.1.3

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

PSVIItem.hpp
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18 /*
19 * $Id: PSVIItem.hpp 932887 2010-04-11 13:04:59Z borisk $
20 */
21
22 #if !defined(XERCESC_INCLUDE_GUARD_PSVIITEM_HPP)
23 #define XERCESC_INCLUDE_GUARD_PSVIITEM_HPP
24
25 #include <xercesc/util/PlatformUtils.hpp>
26
27 XERCES_CPP_NAMESPACE_BEGIN
28
36 // forward declarations
37 class XSTypeDefinition;
38 class XSSimpleTypeDefinition;
39 class XSValue;
40
41 class XMLPARSER_EXPORT PSVIItem : public XMemory
42 {
43 public:
44
45 enum VALIDITY_STATE {
50 VALIDITY_NOTKNOWN = 0,
51
56 VALIDITY_INVALID = 1,
57
62 VALIDITY_VALID = 2
63 };
64
65 enum ASSESSMENT_TYPE {
69 VALIDATION_NONE = 0,
70
74 VALIDATION_PARTIAL = 1,
75
78 VALIDATION_FULL = 2
79 };
80
81 // Constructors and Destructor
82 // -----------------------------------------------------------------------
85
91 PSVIItem(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
92
94
97 virtual ~PSVIItem();
99
100 //---------------------
104
114 const XMLCh *getValidationContext();
115
123 VALIDITY_STATE getValidity() const;
124
131 ASSESSMENT_TYPE getValidationAttempted() const;
132
139 /***
140 const XMLCh ** getErrorCodes();
141 ****/
142
149 const XMLCh *getSchemaNormalizedValue();
150
156 virtual XSTypeDefinition *getTypeDefinition() = 0;
157
167 virtual XSSimpleTypeDefinition *getMemberTypeDefinition() = 0;
168
175 const XMLCh *getSchemaDefault();
176
182 bool getIsSchemaSpecified() const;
183
191 const XMLCh *getCanonicalRepresentation() const;
192
194
202 virtual XSValue *getActualValue() const;
203
204 //----------------------------------
208
209 void setValidationAttempted(PSVIItem::ASSESSMENT_TYPE attemptType);
210 void setValidity(PSVIItem::VALIDITY_STATE validity);
211
218 void reset(
219 const XMLCh* const validationContext
220 , const XMLCh* const normalizedValue
221 , const VALIDITY_STATE validityState
222 , const ASSESSMENT_TYPE assessmentType
223 );
225 private:
226
227 // -----------------------------------------------------------------------
228 // Unimplemented constructors and operators
229 // -----------------------------------------------------------------------
230 PSVIItem(const PSVIItem&);
231 PSVIItem & operator=(const PSVIItem &);
232
233
234 protected:
235 // -----------------------------------------------------------------------
236 // data members
237 // -----------------------------------------------------------------------
238 // fMemoryManager:
239 // used for any memory allocations
240 // fValidationContext
241 // corresponds to the schema [validation context] property
242 // fNormalizedValue
243 // The schema normalized value (when present)
244 // fDefaultValue
245 // default value specified in the schema, if any
246 // fCanonicalValue
247 // canonicalized version of normalizedValue
248 // fValidityState
249 // Whether this item is valid or not
250 // fAssessmentType
251 // The kind of assessment that produced the given validity outcome
252 // fIsSpecified
253 // Whether this item exists because a default was specified in the schema
254 // fType
255 // type responsible for validating this item
256 // fMemberType
257 // If fType is a union type, the member type that validated this item
258 MemoryManager* const fMemoryManager;
259 const XMLCh* fValidationContext;
260 const XMLCh* fNormalizedValue;
261 const XMLCh* fDefaultValue;
262 XMLCh* fCanonicalValue;
263 VALIDITY_STATE fValidityState;
264 ASSESSMENT_TYPE fAssessmentType;
265 bool fIsSpecified;
266 XSTypeDefinition * fType;
267 XSSimpleTypeDefinition* fMemberType;
268 };
269
270 inline PSVIItem::~PSVIItem() {}
271
272 inline const XMLCh *PSVIItem::getValidationContext()
273 {
274 return fValidationContext;
275 }
276
277 inline const XMLCh* PSVIItem::getSchemaNormalizedValue()
278 {
279 return fNormalizedValue;
280 }
281
282 inline const XMLCh* PSVIItem::getSchemaDefault()
283 {
284 return fDefaultValue;
285 }
286
287 inline const XMLCh* PSVIItem::getCanonicalRepresentation() const
288 {
289 return fCanonicalValue;
290 }
291
292 inline PSVIItem::VALIDITY_STATE PSVIItem::getValidity() const
293 {
294 return fValidityState;
295 }
296
297 inline bool PSVIItem::getIsSchemaSpecified() const
298 {
299 return fIsSpecified;
300 }
301
302 inline PSVIItem::ASSESSMENT_TYPE PSVIItem::getValidationAttempted() const
303 {
304 return fAssessmentType;
305 }
306
307 XERCES_CPP_NAMESPACE_END
308
309 #endif