Qt 4.8
|
Encapsulates the resolving of type/element references in a schema after parsing has finished. More...
#include <qxsdschemaresolver_p.h>
Classes | |
class | AlternativeType |
class | AlternativeTypeElement |
class | AttributeType |
class | ComplexBaseType |
class | ComplexContentType |
class | ElementType |
class | KeyReference |
class | RedefinedAttributeGroups |
class | RedefinedGroups |
class | SimpleListType |
class | SimpleRestrictionBase |
class | SimpleUnionType |
class | SubstitutionGroupAffiliation |
Public Types | |
typedef QExplicitlySharedDataPointer< XsdSchemaResolver > | Ptr |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Encapsulates the resolving of type/element references in a schema after parsing has finished.
This class collects task for resolving types or element references. After the parsing has finished, one can start the resolve process by calling resolve().
Definition at line 89 of file qxsdschemaresolver_p.h.
Definition at line 92 of file qxsdschemaresolver_p.h.
XsdSchemaResolver::XsdSchemaResolver | ( | const QExplicitlySharedDataPointer< XsdSchemaContext > & | context, |
const XsdSchemaParserContext * | parserContext | ||
) |
Creates a new schema resolver.
context | The schema context used for error reporting etc.. |
parserContext | The schema parser context where all objects to resolve belong to. |
Definition at line 59 of file qxsdschemaresolver.cpp.
XsdSchemaResolver::~XsdSchemaResolver | ( | ) |
void XsdSchemaResolver::addAllGroupCheck | ( | const XsdReference::Ptr & | reference | ) |
Adds a check for nested all groups.
Definition at line 295 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseChoice(), QPatternist::XsdSchemaParser::parseLocalChoice(), QPatternist::XsdSchemaParser::parseLocalSequence(), and QPatternist::XsdSchemaParser::parseSequence().
void XsdSchemaResolver::addAlternativeType | ( | const XsdAlternative::Ptr & | alternative, |
const QXmlName & | typeName, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the type of an alternative.
The resolver will set the type of the alternative
to the type named by typeName
.
Definition at line 233 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseAlternative(), QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().
void XsdSchemaResolver::addAlternativeType | ( | const XsdAlternative::Ptr & | alternative, |
const XsdElement::Ptr & | element | ||
) |
Adds a resolve task for the type of an alternative.
The resolver will set the type of the alternative
to the type of the element
after the type of the element
has been resolved.
Definition at line 243 of file qxsdschemaresolver.cpp.
void XsdSchemaResolver::addAttributeType | ( | const XsdAttribute::Ptr & | attribute, |
const QXmlName & | typeName, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the type of an attribute.
The resolver will set the type of the attribute
to the type named by typeName
.
Definition at line 223 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseGlobalAttribute(), and QPatternist::XsdSchemaParser::parseLocalAttribute().
void XsdSchemaResolver::addComplexBaseType | ( | const XsdComplexType::Ptr & | complexType, |
const QXmlName & | baseName, | ||
const QSourceLocation & | location, | ||
const XsdFacet::Hash & | facets = XsdFacet::Hash() |
||
) |
Adds a resolve task for the base type of a complex type.
The resolver will set the base type of complexType
to the type named by baseName
.
Definition at line 193 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseComplexContentExtension(), QPatternist::XsdSchemaParser::parseComplexContentRestriction(), QPatternist::XsdSchemaParser::parseSimpleContentExtension(), and QPatternist::XsdSchemaParser::parseSimpleContentRestriction().
void XsdSchemaResolver::addComplexContentType | ( | const XsdComplexType::Ptr & | complexType, |
const XsdParticle::Ptr & | content, | ||
bool | mixed | ||
) |
Adds a resolve task for the content type of a complex type.
The resolver will set the content type properties for complexType
based on the given explicit content
and effective mixed
value.
Definition at line 214 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::resolveComplexContentType().
void XsdSchemaResolver::addComponentLocationHash | ( | const QHash< NamedSchemaComponent::Ptr, QSourceLocation > & | hash | ) |
Adds the component location hash, so the resolver is able to report meaning full error messages.
Definition at line 267 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parse().
void XsdSchemaResolver::addElementType | ( | const XsdElement::Ptr & | element, |
const QXmlName & | typeName, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the type of an element.
The resolver will set the type of the element
to the type named by typeName
.
Definition at line 183 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().
void XsdSchemaResolver::addEnumerationFacetValue | ( | const AtomicValue::Ptr & | facetValue, |
const NamespaceSupport & | namespaceSupport | ||
) |
Add a resolve task for enumeration facet values.
In case the enumeration is of type QName or NOTATION, we have to resolve the QName later, so we store the namespace bindings together with the facet value here and resolve it as soon as we have all type information available.
Definition at line 272 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseEnumerationFacet().
void XsdSchemaResolver::addKeyReference | ( | const XsdElement::Ptr & | element, |
const XsdIdentityConstraint::Ptr & | keyRef, | ||
const QXmlName & | name, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for key references.
The resolver will try to set the referencedKey property of keyRef
to the key or unique object of element
that has the given name
.
Definition at line 132 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseKeyRef().
void XsdSchemaResolver::addRedefinedAttributeGroups | ( | const XsdAttributeGroup::Ptr & | redefinedGroup, |
const XsdAttributeGroup::Ptr & | group | ||
) |
Add a check job for redefined attribute groups.
When an attribute group is redefined, we have to check whether the redefined group is a valid restriction of the group it redefines. As we need all type information for that, we keep them here for later checking.
Definition at line 286 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseRedefine().
void XsdSchemaResolver::addRedefinedGroups | ( | const XsdModelGroup::Ptr & | redefinedGroup, |
const XsdModelGroup::Ptr & | group | ||
) |
Add a check job for redefined groups.
When an element group is redefined, we have to check whether the redefined group is a valid restriction of the group it redefines. As we need all type information for that, we keep them here for later checking.
Definition at line 277 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseRedefine().
void XsdSchemaResolver::addSimpleListType | ( | const XsdSimpleType::Ptr & | simpleType, |
const QXmlName & | typeName, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the list type of a simple type.
The resolver will set the itemType property of simpleType
to the type named by typeName
.
Definition at line 163 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseList().
void XsdSchemaResolver::addSimpleRestrictionBase | ( | const XsdSimpleType::Ptr & | simpleType, |
const QXmlName & | baseName, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the base type of restriction of a simple type.
The resolver will set the base type of simpleType
to the type named by baseName
.
Definition at line 143 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseSimpleRestriction().
void XsdSchemaResolver::addSimpleUnionTypes | ( | const XsdSimpleType::Ptr & | simpleType, |
const QList< QXmlName > & | typeNames, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the member types of a simple type.
The resolver will set the memberTypes property of simpleType
to the types named by typeNames
.
Definition at line 173 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseUnion().
void XsdSchemaResolver::addSubstitutionGroupAffiliation | ( | const XsdElement::Ptr & | element, |
const QList< QXmlName > & | elementName, | ||
const QSourceLocation & | location | ||
) |
Adds a resolve task for the substituion group affiliations of an element.
The resolver will set the substitution group affiliations of the element
to the top-level element named by elementNames
.
Definition at line 252 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseGlobalElement().
void XsdSchemaResolver::addSubstitutionGroupType | ( | const XsdElement::Ptr & | element | ) |
Adds a resolve task for an element that has no type specified, only a substitution group affiliation.
The resolver will set the type of the substitution group affiliation as type for the element.
Definition at line 262 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseGlobalElement().
QXmlName XsdSchemaResolver::baseTypeNameOfType | ( | const SchemaType::Ptr & | type | ) | const |
Returns the to resolve base type name for the given type
.
Definition at line 316 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseRedefine().
|
private |
Checks the redefined attribute groups.
Definition at line 1685 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Checks the redefined groups.
Definition at line 1660 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Returns the facets that are marked for the given complex type
with a simple type restriction.
Definition at line 1650 of file qxsdschemaresolver.cpp.
Referenced by resolveSimpleContentComplexTypes().
void XsdSchemaResolver::copyDataTo | ( | const XsdSchemaResolver::Ptr & | other | ) | const |
Copies the data to resolve to an other
resolver.
Definition at line 300 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseRedefine().
|
private |
Finds the primitive type for the given simple type
.
The type is found by walking up the inheritance tree, until one of the builtin primitive type definitions is reached.
Definition at line 1703 of file qxsdschemaresolver.cpp.
Referenced by resolveSimpleContentComplexTypes(), and resolveSimpleRestrictions().
void XsdSchemaResolver::removeComplexBaseType | ( | const XsdComplexType::Ptr & | type | ) |
Removes the resolve task for the base type of the complex type
.
Definition at line 204 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseRedefine().
void XsdSchemaResolver::removeSimpleRestrictionBase | ( | const XsdSimpleType::Ptr & | type | ) |
Removes the resolve task for the base type of restriction of the simple type
.
Definition at line 153 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parseRedefine().
void XsdSchemaResolver::resolve | ( | ) |
Starts the resolve process.
Definition at line 83 of file qxsdschemaresolver.cpp.
|
private |
Resolves alternative types.
Definition at line 975 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves the attribute inheritance of complex types.
Definition at line 1394 of file qxsdschemaresolver.cpp.
Referenced by resolve(), and resolveAttributeInheritance().
|
private |
Resolves the attribute inheritance of the given complex types.
complexType | The complex type to resolve. |
visitedTypes | A set of already resolved types, used for termination of recursion. |
Definition at line 1440 of file qxsdschemaresolver.cpp.
|
private |
Resolves all XsdAttributeReferences in the schema by their corresponding XsdAttributeUse objects.
Definition at line 1254 of file qxsdschemaresolver.cpp.
Referenced by resolve(), and resolveAttributeTermReferences().
|
private |
Resolves all XsdAttributeReferences in the list of attributeUses
by their corresponding XsdAttributeUse objects.
Definition at line 1296 of file qxsdschemaresolver.cpp.
|
private |
Resolves attribute types.
Definition at line 945 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves base type of complex types.
Definition at line 552 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves the complex content model of a complex type depending on its base type.
Definition at line 688 of file qxsdschemaresolver.cpp.
Referenced by resolve(), and resolveComplexContentComplexTypes().
|
private |
Resolves the complex content model of a complex type depending on its base type.
complexType | The complex type to resolve. |
visitedTypes | A set of already resolved types, used for termination of recursion. |
Definition at line 713 of file qxsdschemaresolver.cpp.
|
private |
Resolves element types.
Definition at line 530 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves the enumeration facet values for QName and NOTATION based facets.
Definition at line 1575 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves key references.
Definition at line 347 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves the simple content model of a complex type depending on its base type.
Definition at line 584 of file qxsdschemaresolver.cpp.
Referenced by resolve(), and resolveSimpleContentComplexTypes().
|
private |
Resolves the simple content model of a complex type depending on its base type.
complexType | The complex type to resolve. |
visitedTypes | A set of already resolved types, used for termination of recursion. |
Definition at line 609 of file qxsdschemaresolver.cpp.
|
private |
Resolves the item type property of simple types derived by list.
Definition at line 469 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves the base types of simple types derived by restriction.
Definition at line 385 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves the other properties except the base type of all simple restrictions.
Definition at line 409 of file qxsdschemaresolver.cpp.
Referenced by resolve(), and resolveSimpleRestrictions().
|
private |
Resolves the other properties except the base type of the given simple restriction.
simpleType | The restricted type to resolve. |
visitedTypes | A set of already resolved types, used for termination of recursion. |
Definition at line 433 of file qxsdschemaresolver.cpp.
|
private |
Resolves the member types property of simple types derived by union.
Definition at line 493 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves substitution group affiliations.
Definition at line 1017 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves substitution groups.
Definition at line 1065 of file qxsdschemaresolver.cpp.
Referenced by resolve().
|
private |
Resolves all XsdReferences in the particle
recursive by their corresponding XsdElement or XsdModelGroup terms.
Definition at line 1120 of file qxsdschemaresolver.cpp.
Referenced by resolveTermReferences().
|
private |
Resolves all XsdReferences in the schema by their corresponding XsdElement or XsdModelGroup terms.
Definition at line 1084 of file qxsdschemaresolver.cpp.
Referenced by resolve().
void XsdSchemaResolver::setDefaultOpenContent | ( | const XsdComplexType::OpenContent::Ptr & | openContent, |
bool | appliesToEmpty | ||
) |
Sets the defaultOpenContent object from the schema parser.
Definition at line 341 of file qxsdschemaresolver.cpp.
Referenced by QPatternist::XsdSchemaParser::parse().
|
private |
Returns the source location of the given schema component
or a dummy source location if the component is not found in the component location hash.
Definition at line 1636 of file qxsdschemaresolver.cpp.
Referenced by checkRedefinedAttributeGroups(), checkRedefinedGroups(), resolveAttributeInheritance(), resolveComplexContentComplexTypes(), resolveEnumerationFacetValues(), and resolveTermReference().
QXmlName XsdSchemaResolver::typeNameOfAttribute | ( | const XsdAttribute::Ptr & | attribute | ) | const |
Returns the to resolve type name for the given attribute
.
Definition at line 331 of file qxsdschemaresolver.cpp.
|
private |
Definition at line 561 of file qxsdschemaresolver_p.h.
Referenced by addAllGroupCheck(), and resolveTermReference().
|
private |
Definition at line 555 of file qxsdschemaresolver_p.h.
Referenced by addAlternativeType(), copyDataTo(), resolveAlternativeTypes(), and XsdSchemaResolver().
|
private |
Definition at line 554 of file qxsdschemaresolver_p.h.
Referenced by addAlternativeType(), copyDataTo(), resolveAlternativeTypes(), and XsdSchemaResolver().
|
private |
Definition at line 553 of file qxsdschemaresolver_p.h.
Referenced by addAttributeType(), copyDataTo(), resolveAttributeTypes(), typeNameOfAttribute(), and XsdSchemaResolver().
|
private |
Definition at line 564 of file qxsdschemaresolver_p.h.
Referenced by resolve().
|
private |
Definition at line 551 of file qxsdschemaresolver_p.h.
Referenced by addComplexBaseType(), baseTypeNameOfType(), complexTypeFacets(), copyDataTo(), removeComplexBaseType(), resolveComplexBaseTypes(), and XsdSchemaResolver().
|
private |
Definition at line 552 of file qxsdschemaresolver_p.h.
Referenced by addComplexContentType(), copyDataTo(), and resolveComplexContentComplexTypes().
|
private |
Definition at line 567 of file qxsdschemaresolver_p.h.
Referenced by addComponentLocationHash(), resolve(), resolveSimpleContentComplexTypes(), and sourceLocation().
|
private |
Definition at line 563 of file qxsdschemaresolver_p.h.
Referenced by checkRedefinedAttributeGroups(), checkRedefinedGroups(), resolveAlternativeTypes(), resolveAttributeInheritance(), resolveAttributeTermReferences(), resolveAttributeTypes(), resolveComplexBaseTypes(), resolveComplexContentComplexTypes(), resolveElementTypes(), resolveEnumerationFacetValues(), resolveKeyReferences(), resolveSimpleListType(), resolveSimpleRestrictionBaseTypes(), resolveSimpleUnionTypes(), resolveSubstitutionGroupAffiliations(), resolveTermReference(), and XsdSchemaResolver().
|
private |
Definition at line 568 of file qxsdschemaresolver_p.h.
Referenced by resolveComplexContentComplexTypes(), and setDefaultOpenContent().
|
private |
Definition at line 569 of file qxsdschemaresolver_p.h.
Referenced by resolveComplexContentComplexTypes(), and setDefaultOpenContent().
|
private |
Definition at line 550 of file qxsdschemaresolver_p.h.
Referenced by addElementType(), copyDataTo(), resolveElementTypes(), and XsdSchemaResolver().
|
private |
Definition at line 560 of file qxsdschemaresolver_p.h.
Referenced by addEnumerationFacetValue(), and resolveEnumerationFacetValues().
|
private |
Definition at line 546 of file qxsdschemaresolver_p.h.
Referenced by addKeyReference(), copyDataTo(), resolveKeyReferences(), and XsdSchemaResolver().
|
private |
Definition at line 565 of file qxsdschemaresolver_p.h.
Referenced by checkRedefinedAttributeGroups(), checkRedefinedGroups(), findPrimitiveType(), resolveAlternativeTypes(), resolveAttributeInheritance(), resolveAttributeTermReferences(), resolveAttributeTypes(), resolveComplexBaseTypes(), resolveComplexContentComplexTypes(), resolveElementTypes(), resolveEnumerationFacetValues(), resolveKeyReferences(), resolveSimpleListType(), resolveSimpleRestrictionBaseTypes(), resolveSimpleUnionTypes(), resolveSubstitutionGroupAffiliations(), resolveSubstitutionGroups(), and resolveTermReference().
|
private |
Definition at line 570 of file qxsdschemaresolver_p.h.
Referenced by resolveSimpleRestrictions(), and XsdSchemaResolver().
|
private |
Definition at line 559 of file qxsdschemaresolver_p.h.
Referenced by addRedefinedAttributeGroups(), and checkRedefinedAttributeGroups().
|
private |
Definition at line 558 of file qxsdschemaresolver_p.h.
Referenced by addRedefinedGroups(), and checkRedefinedGroups().
|
private |
Definition at line 566 of file qxsdschemaresolver_p.h.
Referenced by resolveAlternativeTypes(), resolveAttributeInheritance(), resolveAttributeTermReferences(), resolveAttributeTypes(), resolveComplexBaseTypes(), resolveComplexContentComplexTypes(), resolveElementTypes(), resolveEnumerationFacetValues(), resolveKeyReferences(), resolveSimpleContentComplexTypes(), resolveSimpleListType(), resolveSimpleRestrictionBaseTypes(), resolveSimpleRestrictions(), resolveSimpleUnionTypes(), resolveSubstitutionGroupAffiliations(), resolveSubstitutionGroups(), resolveTermReference(), and resolveTermReferences().
|
private |
Definition at line 548 of file qxsdschemaresolver_p.h.
Referenced by addSimpleListType(), copyDataTo(), resolveSimpleListType(), and XsdSchemaResolver().
|
private |
Definition at line 547 of file qxsdschemaresolver_p.h.
Referenced by addSimpleRestrictionBase(), baseTypeNameOfType(), copyDataTo(), removeSimpleRestrictionBase(), resolveSimpleRestrictionBaseTypes(), and XsdSchemaResolver().
|
private |
Definition at line 549 of file qxsdschemaresolver_p.h.
Referenced by addSimpleUnionTypes(), copyDataTo(), resolveSimpleUnionTypes(), and XsdSchemaResolver().
|
private |
Definition at line 556 of file qxsdschemaresolver_p.h.
Referenced by addSubstitutionGroupAffiliation(), copyDataTo(), resolveSubstitutionGroupAffiliations(), and XsdSchemaResolver().
|
private |
Definition at line 557 of file qxsdschemaresolver_p.h.
Referenced by addSubstitutionGroupType(), copyDataTo(), and resolveSubstitutionGroupAffiliations().