PSVIItem.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIITEM_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIITEM_HPP
#include <xercesc/util/PlatformUtils.hpp>
XERCES_CPP_NAMESPACE_BEGIN
// forward declarations
class XSTypeDefinition;
class XSSimpleTypeDefinition;
class XSValue;
class XMLPARSER_EXPORT PSVIItem : public XMemory
{
public:
enum VALIDITY_STATE {
VALIDITY_NOTKNOWN = 0,
VALIDITY_INVALID = 1,
VALIDITY_VALID = 2
};
enum ASSESSMENT_TYPE {
VALIDATION_NONE = 0,
VALIDATION_PARTIAL = 1,
VALIDATION_FULL = 2
};
// Constructors and Destructor
// -----------------------------------------------------------------------
PSVIItem(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
virtual ~PSVIItem();
//---------------------
const XMLCh *getValidationContext();
VALIDITY_STATE getValidity() const;
ASSESSMENT_TYPE getValidationAttempted() const;
/***
const XMLCh ** getErrorCodes();
****/
const XMLCh *getSchemaNormalizedValue();
virtual XSTypeDefinition *getTypeDefinition() = 0;
virtual XSSimpleTypeDefinition *getMemberTypeDefinition() = 0;
const XMLCh *getSchemaDefault();
bool getIsSchemaSpecified() const;
const XMLCh *getCanonicalRepresentation() const;
virtual XSValue *getActualValue() const;
//----------------------------------
void setValidationAttempted(PSVIItem::ASSESSMENT_TYPE attemptType);
void setValidity(PSVIItem::VALIDITY_STATE validity);
void reset(
const XMLCh* const validationContext
, const XMLCh* const normalizedValue
, const VALIDITY_STATE validityState
, const ASSESSMENT_TYPE assessmentType
);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIItem(const PSVIItem&);
PSVIItem & operator=(const PSVIItem &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fMemoryManager:
// used for any memory allocations
// fValidationContext
// corresponds to the schema [validation context] property
// fNormalizedValue
// The schema normalized value (when present)
// fDefaultValue
// default value specified in the schema, if any
// fCanonicalValue
// canonicalized version of normalizedValue
// fValidityState
// Whether this item is valid or not
// fAssessmentType
// The kind of assessment that produced the given validity outcome
// fIsSpecified
// Whether this item exists because a default was specified in the schema
// fType
// type responsible for validating this item
// fMemberType
// If fType is a union type, the member type that validated this item
MemoryManager* const fMemoryManager;
const XMLCh* fValidationContext;
const XMLCh* fNormalizedValue;
const XMLCh* fDefaultValue;
XMLCh* fCanonicalValue;
VALIDITY_STATE fValidityState;
ASSESSMENT_TYPE fAssessmentType;
bool fIsSpecified;
XSTypeDefinition * fType;
XSSimpleTypeDefinition* fMemberType;
};
inline PSVIItem::~PSVIItem() {}
inline const XMLCh *PSVIItem::getValidationContext()
{
return fValidationContext;
}
inline const XMLCh* PSVIItem::getSchemaNormalizedValue()
{
return fNormalizedValue;
}
inline const XMLCh* PSVIItem::getSchemaDefault()
{
return fDefaultValue;
}
inline const XMLCh* PSVIItem::getCanonicalRepresentation() const
{
return fCanonicalValue;
}
inline PSVIItem::VALIDITY_STATE PSVIItem::getValidity() const
{
return fValidityState;
}
inline bool PSVIItem::getIsSchemaSpecified() const
{
return fIsSpecified;
}
inline PSVIItem::ASSESSMENT_TYPE PSVIItem::getValidationAttempted() const
{
return fAssessmentType;
}
XERCES_CPP_NAMESPACE_END
#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
char16_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