Xerces-C++ 3.2.5

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$
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
PlatformUtils.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLCh
uint16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
PSVIItem
Definition PSVIItem.hpp:42
PSVIItem::fMemberType
XSSimpleTypeDefinition * fMemberType
Definition PSVIItem.hpp:267
PSVIItem::fAssessmentType
ASSESSMENT_TYPE fAssessmentType
Definition PSVIItem.hpp:264
PSVIItem::fIsSpecified
bool fIsSpecified
Definition PSVIItem.hpp:265
PSVIItem::getSchemaNormalizedValue
const XMLCh * getSchemaNormalizedValue()
A list of error codes generated from validation attempts.
Definition PSVIItem.hpp:277
PSVIItem::fMemoryManager
MemoryManager *const fMemoryManager
Definition PSVIItem.hpp:258
PSVIItem::getCanonicalRepresentation
const XMLCh * getCanonicalRepresentation() const
Return the canonical representation of this value.
Definition PSVIItem.hpp:287
PSVIItem::reset
void reset(const XMLCh *const validationContext, const XMLCh *const normalizedValue, const VALIDITY_STATE validityState, const ASSESSMENT_TYPE assessmentType)
reset the object
PSVIItem::setValidity
void setValidity(PSVIItem::VALIDITY_STATE validity)
PSVIItem::getValidity
VALIDITY_STATE getValidity() const
Determine the validity of the node with respect to the validation being attempted.
Definition PSVIItem.hpp:292
PSVIItem::getSchemaDefault
const XMLCh * getSchemaDefault()
[schema default]
Definition PSVIItem.hpp:282
PSVIItem::fDefaultValue
const XMLCh * fDefaultValue
Definition PSVIItem.hpp:261
PSVIItem::getValidationAttempted
ASSESSMENT_TYPE getValidationAttempted() const
Determines the extent to which the item has been validated.
Definition PSVIItem.hpp:302
PSVIItem::VALIDITY_STATE
VALIDITY_STATE
Definition PSVIItem.hpp:45
PSVIItem::getMemberTypeDefinition
virtual XSSimpleTypeDefinition * getMemberTypeDefinition()=0
If and only if that type definition is a simple type definition with {variety} union,...
PSVIItem::fValidationContext
const XMLCh * fValidationContext
Definition PSVIItem.hpp:259
PSVIItem::getActualValue
virtual XSValue * getActualValue() const
Get actual value in the form of XSValue, caller needs to delete the object returned.
PSVIItem::getIsSchemaSpecified
bool getIsSchemaSpecified() const
[schema specified]
Definition PSVIItem.hpp:297
PSVIItem::fValidityState
VALIDITY_STATE fValidityState
Definition PSVIItem.hpp:263
PSVIItem::fNormalizedValue
const XMLCh * fNormalizedValue
Definition PSVIItem.hpp:260
PSVIItem::getValidationContext
const XMLCh * getValidationContext()
[validation context]
Definition PSVIItem.hpp:272
PSVIItem::setValidationAttempted
void setValidationAttempted(PSVIItem::ASSESSMENT_TYPE attemptType)
methods needed by implementation
PSVIItem::PSVIItem
PSVIItem(MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager)
The default constructor.
PSVIItem::fType
XSTypeDefinition * fType
Definition PSVIItem.hpp:266
PSVIItem::~PSVIItem
virtual ~PSVIItem()
Definition PSVIItem.hpp:270
PSVIItem::ASSESSMENT_TYPE
ASSESSMENT_TYPE
Definition PSVIItem.hpp:65
PSVIItem::getTypeDefinition
virtual XSTypeDefinition * getTypeDefinition()=0
An item isomorphic to the type definition used to validate this element.
PSVIItem::fCanonicalValue
XMLCh * fCanonicalValue
Definition PSVIItem.hpp:262
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
XMemory
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition XMemory.hpp:41
XSSimpleTypeDefinition
Definition XSSimpleTypeDefinition.hpp:44
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition XSTypeDefinition.hpp:40
XSValue
Definition XSValue.hpp:33