Qt 4.8
|
Base class for W3C XML Schema types. More...
#include <qschematype_p.h>
Public Types | |
enum | DerivationConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, ListConstraint = 4, UnionConstraint = 8 } |
enum | DerivationMethod { DerivationRestriction = 1, DerivationExtension = 2, DerivationUnion = 4, DerivationList = 8, NoDerivation = 16 } |
typedef QHash< QXmlName, SchemaType::Ptr > | Hash |
typedef QList< SchemaType::Ptr > | List |
typedef QExplicitlySharedDataPointer< SchemaType > | Ptr |
enum | TypeCategory { None = 0, SimpleTypeAtomic, SimpleTypeList, SimpleTypeUnion, ComplexType } |
Public Functions | |
virtual TypeCategory | category () const =0 |
virtual DerivationConstraints | derivationConstraints () const =0 |
virtual DerivationMethod | derivationMethod () const =0 |
virtual QString | displayName (const NamePool::Ptr &np) const =0 |
Returns a suitable display name for this type. More... | |
virtual bool | isAbstract () const =0 |
virtual bool | isComplexType () const |
virtual bool | isDefinedBySchema () const |
virtual bool | isSimpleType () const |
virtual QXmlName | name (const NamePool::Ptr &np) const =0 |
Returns the name of the type. More... | |
SchemaType () | |
virtual SchemaType::Ptr | wxsSuperType () const =0 |
virtual bool | wxsTypeMatches (const SchemaType::Ptr &other) const =0 |
virtual | ~SchemaType () |
Public Functions inherited from QPatternist::SchemaComponent | |
SchemaComponent () | |
virtual | ~SchemaComponent () |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Base class for W3C XML Schema types.
This is the base class of all data types in a W3C XML Schema.
Definition at line 78 of file qschematype_p.h.
Definition at line 83 of file qschematype_p.h.
Definition at line 84 of file qschematype_p.h.
Definition at line 82 of file qschematype_p.h.
Describes the derivation constraints that are given by the 'final' or 'block' attributes.
Enumerator | |
---|---|
RestrictionConstraint | |
ExtensionConstraint | |
ListConstraint | |
UnionConstraint |
Definition at line 125 of file qschematype_p.h.
Enumerator | |
---|---|
DerivationRestriction | |
DerivationExtension | |
DerivationUnion | |
DerivationList | |
NoDerivation | Used for |
Definition at line 110 of file qschematype_p.h.
Schema types are divided into different categories such as complex type, atomic imple type, union simple type, and so forth. This enumerator, which category() returns a value of, identifies what category the type belong to.
Definition at line 94 of file qschematype_p.h.
SchemaType::SchemaType | ( | ) |
Definition at line 48 of file qschematype.cpp.
|
virtual |
Definition at line 52 of file qschematype.cpp.
|
pure virtual |
Implemented in QPatternist::XsdComplexType, QPatternist::XsdSimpleType, QPatternist::AtomicType, QPatternist::AnyType, QPatternist::AnySimpleType, and QPatternist::Untyped.
Referenced by QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkElementConstraints(), QPatternist::XsdSchemaChecker::checkSimpleDerivationRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), QPatternist::ComparisonFactory::compare(), QPatternist::ComparisonFactory::constructAndCompare(), QPatternist::XsdSchemaHelper::constructAndCompare(), QPatternist::ValueFactory::fromLexical(), isComplexType(), QPatternist::XsdSchemaHelper::isSimpleDerivationOk(), isSimpleType(), QPatternist::XsdSchemaResolver::resolveAttributeTypes(), and QPatternist::XsdSchemaResolver::resolveSimpleRestrictions().
|
pure virtual |
Determines what derivation constraints exists for the type.
Implemented in QPatternist::AnyType, QPatternist::XsdUserSchemaType< AnyType >, and QPatternist::XsdUserSchemaType< AnySimpleType >.
Referenced by QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), and QPatternist::XsdSchemaHelper::isSimpleDerivationOk().
|
pure virtual |
Determines how this SchemaType is derived from its super type.
xs:anyType
, this function returns NoDerivation.Implemented in QPatternist::XsdComplexType, QPatternist::XsdSimpleType, QPatternist::AtomicType, QPatternist::AnyType, QPatternist::AnySimpleType, and QPatternist::Untyped.
Referenced by QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaHelper::foundSubstitutionGroupTypeInheritance(), QPatternist::XsdSchemaHelper::isComplexDerivationOk(), and QPatternist::XsdSchemaResolver::resolveSimpleRestrictions().
|
pure virtual |
Returns a suitable display name for this type.
See name() for an explanation to why we take a NamePool as argument.
Implemented in QPatternist::NOTATIONType, QPatternist::DerivedStringType< derivedType >, QPatternist::StringType, QPatternist::QNameType, QPatternist::AnyURIType, QPatternist::HexBinaryType, QPatternist::Base64BinaryType, QPatternist::BooleanType, QPatternist::GMonthType, QPatternist::GDayType, QPatternist::GMonthDayType, QPatternist::GYearType, QPatternist::GYearMonthType, QPatternist::DerivedIntegerType< derivedType >, QPatternist::IntegerType, QPatternist::DecimalType, QPatternist::FloatType, QPatternist::DoubleType, QPatternist::DayTimeDurationType, QPatternist::XsdComplexType, QPatternist::YearMonthDurationType, QPatternist::DurationType, QPatternist::SchemaTimeType, QPatternist::DateType, QPatternist::DateTimeType, QPatternist::UntypedAtomicType, QPatternist::AtomicType, QPatternist::XsdUserSchemaType< AnyType >, QPatternist::XsdUserSchemaType< AnySimpleType >, QPatternist::XsdSimpleType, QPatternist::AnySimpleType, QPatternist::AnyType, QPatternist::AnyAtomicType, and QPatternist::NumericType.
Referenced by QPatternist::XsdSchemaDebugger::dumpElement(), QPatternist::XsdSchemaDebugger::dumpInheritance(), and QPatternist::XsdSchemaDebugger::dumpType().
|
pure virtual |
Determines whether the type is an abstract type.
Implemented in QPatternist::NOTATIONType, QPatternist::XsdComplexType, QPatternist::AnyAtomicType, QPatternist::AnyType, QPatternist::NumericType, and QPatternist::BuiltinAtomicType.
|
virtual |
Determines whether the type is a complex type, by introspecting the result of category().
Reimplemented in QPatternist::AnyType, and QPatternist::AnySimpleType.
Definition at line 70 of file qschematype.cpp.
Referenced by QPatternist::XsdSchemaChecker::checkAttributeConstraints(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkBasicComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkBasicSimpleTypeConstraints(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkDuplicatedAttributeUses(), QPatternist::XsdSchemaChecker::checkElementConstraints(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QPatternist::XsdSchemaChecker::checkSimpleDerivationRestrictions(), collectAllElements(), QPatternist::XsdSchema::complexTypes(), derivedTermValid(), QPatternist::XsdSchemaDebugger::dumpType(), QPatternist::XsdSchemaHelper::foundSubstitutionGroupTypeInheritance(), QPatternist::XsdSchemaHelper::isComplexDerivationOk(), QPatternist::XsdSchemaHelper::isValidlySubstitutable(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveAttributeTermReferences(), QPatternist::XsdSchemaResolver::resolveComplexBaseTypes(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveTermReferences(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QPatternist::XsdSchemaHelper::substitutionGroupOkTransitive(), and QPatternist::XsdValidatingInstanceReader::validateElementType().
|
virtual |
Returns whether the value has been defined by a schema (is not a built in type).
Reimplemented in QPatternist::XsdComplexType, and QPatternist::XsdSimpleType.
Definition at line 75 of file qschematype.cpp.
Referenced by QPatternist::XsdSchemaChecker::checkAttributeConstraints(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkBasicComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkCircularInheritances(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkDuplicatedAttributeUses(), QPatternist::XsdSchemaChecker::checkElementConstraints(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleDerivationRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), collectAllElements(), comparableType(), QPatternist::XsdSchema::complexTypes(), derivedTermValid(), QPatternist::XsdSchemaDebugger::dumpType(), QPatternist::XsdSchemaContext::facetsForType(), hasCircularUnionInheritance(), QPatternist::XsdSchemaHelper::isSimpleDerivationOk(), QPatternist::XsdSchemaHelper::isValidlySubstitutable(), QPatternist::XsdTypeChecker::isValidString(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveAttributeTermReferences(), QPatternist::XsdSchemaResolver::resolveComplexBaseTypes(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictions(), QPatternist::XsdSchemaResolver::resolveTermReferences(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QPatternist::XsdSchema::simpleTypes(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), and QPatternist::XsdValidatingInstanceReader::validateElementType().
|
virtual |
Determines whether the type is a simple type, by introspecting the result of category().
Reimplemented in QPatternist::AnySimpleType.
Definition at line 56 of file qschematype.cpp.
Referenced by QPatternist::XsdSchemaParser::addAnonymousType(), QPatternist::XsdSchemaParser::addType(), QPatternist::XsdSchemaChecker::checkBasicComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkBasicSimpleTypeConstraints(), QPatternist::XsdSchemaChecker::checkCircularInheritances(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkElementConstraints(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), derivedTermValid(), hasCircularUnionInheritance(), QPatternist::XsdSchemaHelper::isValidlySubstitutable(), matchesType(), QPatternist::XsdSchemaResolver::resolveAttributeTypes(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveEnumerationFacetValues(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictions(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QPatternist::XsdSchema::simpleTypes(), QPatternist::XsdSchemaChecker::sourceLocationForType(), and QPatternist::XsdValidatingInstanceReader::validateElementType().
|
pure virtual |
Returns the name of the type.
The reason to why we take the name pool argument, is that the basic types, xs:anySimpleType
and so on, are stored globally in BuiltinTypes and ComonSequenceTypes, and therefore cannot be tied to a certain name pool. Type instances that knows they always will be used with a certain name pool, can therefore ignore np
and return a QXmlName instance stored as a member.
If the type code was refactored to not be store globally and therefore by design would be tied to a name pool, this argument could be removed.
Implemented in QPatternist::NOTATIONType, QPatternist::DerivedStringType< derivedType >, QPatternist::StringType, QPatternist::QNameType, QPatternist::AnyURIType, QPatternist::HexBinaryType, QPatternist::Base64BinaryType, QPatternist::BooleanType, QPatternist::GMonthType, QPatternist::GDayType, QPatternist::GMonthDayType, QPatternist::GYearType, QPatternist::GYearMonthType, QPatternist::DerivedIntegerType< derivedType >, QPatternist::IntegerType, QPatternist::DecimalType, QPatternist::FloatType, QPatternist::DoubleType, QPatternist::DayTimeDurationType, QPatternist::YearMonthDurationType, QPatternist::DurationType, QPatternist::SchemaTimeType, QPatternist::DateType, QPatternist::DateTimeType, QPatternist::UntypedAtomicType, QPatternist::XsdUserSchemaType< AnyType >, QPatternist::XsdUserSchemaType< AnySimpleType >, QPatternist::Untyped, QPatternist::AnySimpleType, QPatternist::AnyAtomicType, and QPatternist::AnyType.
Referenced by QPatternist::XsdSchema::addAnonymousType(), QPatternist::XsdSchema::addType(), QPatternist::XsdSchemaParser::addType(), QPatternist::XsdSchemaChecker::checkBasicSimpleTypeConstraints(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), QPatternist::XsdSchemaHelper::constructAndCompare(), derivedTermValid(), QPatternist::XsdTypeChecker::fromLexical(), QPatternist::XsdTypeChecker::isValidString(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaChecker::particleEqualsRecursively(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QPatternist::XsdValidatingInstanceReader::validateElement(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), and QPatternist::XsdTypeChecker::valuesAreEqual().
|
pure virtual |
This function walks the Schema hierarchy. Some simple types, the atomic types, is also part of the XPath Data Model hierarchy, and their super type in that hierarchy can be introspected with xdtSuperType().
wxsSuperType() can be said to correspond to the {base type definition} property in the Post Schema Valid Infoset(PSVI).
Implemented in QPatternist::XsdComplexType, QPatternist::XsdSimpleType, QPatternist::NumericType, QPatternist::AnyType, QPatternist::AnyAtomicType, QPatternist::AnySimpleType, QPatternist::BuiltinAtomicType, and QPatternist::Untyped.
Referenced by QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkBasicCircularInheritances(), QPatternist::XsdSchemaChecker::checkCircularInheritances(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaDebugger::dumpInheritance(), QPatternist::XsdSchemaHelper::foundSubstitutionGroupTypeInheritance(), hasCircularUnionInheritance(), QPatternist::XsdSchemaHelper::isComplexDerivationOk(), QPatternist::XsdSchemaHelper::isSimpleDerivationOk(), matchesType(), QPatternist::XsdTypeChecker::mergedFacetsForType(), QPatternist::AnyType::wxsTypeMatches(), and wxsTypeMatches().
|
pure virtual |
true
if other
is identical to 'this' schema type or if other
is either directly or indirectly a base type of 'this'. Hence, calling AnyType::wxsTypeMatches() with other
as argument returns true
for all types, since all types have xs:anyType
as super type. Implemented in QPatternist::AnyType.
Referenced by QPatternist::XsdValidatingInstanceReader::validateAttribute(), and QPatternist::XsdValidatingInstanceReader::validateElementSimpleType().