Qt 4.8
qxsdschemaresolver_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtXmlPatterns module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists purely as an
47 // implementation detail. This header file may change from version to
48 // version without notice, or even be removed.
49 //
50 // We mean it.
51 
52 #ifndef Patternist_XsdSchemaResolver_H
53 #define Patternist_XsdSchemaResolver_H
54 
55 #include "qnamespacesupport_p.h"
56 #include "qschematype_p.h"
57 #include "qschematypefactory_p.h"
58 #include "qxsdalternative_p.h"
59 #include "qxsdattribute_p.h"
60 #include "qxsdattributegroup_p.h"
61 #include "qxsdelement_p.h"
62 #include "qxsdmodelgroup_p.h"
63 #include "qxsdnotation_p.h"
64 #include "qxsdreference_p.h"
65 #include "qxsdschema_p.h"
66 #include "qxsdschemachecker_p.h"
67 #include "qxsdsimpletype_p.h"
68 
69 #include <QtCore/QExplicitlySharedDataPointer>
70 
72 
74 
75 namespace QPatternist
76 {
77  class XsdSchemaContext;
78  class XsdSchemaParserContext;
79 
90  {
91  public:
93 
101 
106 
110  void resolve();
111 
118  void addKeyReference(const XsdElement::Ptr &element, const XsdIdentityConstraint::Ptr &keyRef, const QXmlName &name, const QSourceLocation &location);
119 
125  void addSimpleRestrictionBase(const XsdSimpleType::Ptr &simpleType, const QXmlName &baseName, const QSourceLocation &location);
126 
131 
137  void addSimpleListType(const XsdSimpleType::Ptr &simpleType, const QXmlName &typeName, const QSourceLocation &location);
138 
144  void addSimpleUnionTypes(const XsdSimpleType::Ptr &simpleType, const QList<QXmlName> &typeNames, const QSourceLocation &location);
145 
151  void addElementType(const XsdElement::Ptr &element, const QXmlName &typeName, const QSourceLocation &location);
152 
158  void addComplexBaseType(const XsdComplexType::Ptr &complexType, const QXmlName &baseName, const QSourceLocation &location, const XsdFacet::Hash &facets = XsdFacet::Hash());
159 
164 
171  void addComplexContentType(const XsdComplexType::Ptr &complexType, const XsdParticle::Ptr &content, bool mixed);
172 
178  void addAttributeType(const XsdAttribute::Ptr &attribute, const QXmlName &typeName, const QSourceLocation &location);
179 
185  void addAlternativeType(const XsdAlternative::Ptr &alternative, const QXmlName &typeName, const QSourceLocation &location);
186 
193  void addAlternativeType(const XsdAlternative::Ptr &alternative, const XsdElement::Ptr &element);
194 
201  void addSubstitutionGroupAffiliation(const XsdElement::Ptr &element, const QList<QXmlName> &elementName, const QSourceLocation &location);
202 
209  void addSubstitutionGroupType(const XsdElement::Ptr &element);
210 
216 
224  void addEnumerationFacetValue(const AtomicValue::Ptr &facetValue, const NamespaceSupport &namespaceSupport);
225 
233  void addRedefinedGroups(const XsdModelGroup::Ptr &redefinedGroup, const XsdModelGroup::Ptr &group);
234 
242  void addRedefinedAttributeGroups(const XsdAttributeGroup::Ptr &redefinedGroup, const XsdAttributeGroup::Ptr &group);
243 
247  void addAllGroupCheck(const XsdReference::Ptr &reference);
248 
254  void copyDataTo(const XsdSchemaResolver::Ptr &other) const;
255 
262 
268  QXmlName typeNameOfAttribute(const XsdAttribute::Ptr &attribute) const;
269 
273  void setDefaultOpenContent(const XsdComplexType::OpenContent::Ptr &openContent, bool appliesToEmpty);
274 
275  private:
279  void resolveKeyReferences();
280 
285 
291 
299  void resolveSimpleRestrictions(const XsdSimpleType::Ptr &simpleType, QSet<XsdSimpleType::Ptr> &visitedTypes);
300 
304  void resolveSimpleListType();
305 
310 
314  void resolveElementTypes();
315 
320 
326 
332 
341 
350 
354  void resolveAttributeTypes();
355 
360 
365 
370 
374  void resolveTermReferences();
375 
379  void resolveTermReference(const XsdParticle::Ptr &particle, QSet<QXmlName> visitedGroups);
380 
385 
389  XsdAttributeUse::List resolveAttributeTermReferences(const XsdAttributeUse::List &attributeUses, XsdWildcard::Ptr &wildcard, QSet<QXmlName> visitedAttributeGroups);
390 
397 
406  void resolveAttributeInheritance(const XsdComplexType::Ptr &complexType, QSet<XsdComplexType::Ptr> &visitedTypes);
407 
412 
418 
423  XsdFacet::Hash complexTypeFacets(const XsdComplexType::Ptr &complexType) const;
424 
432 
436  void checkRedefinedGroups();
437 
442 
444  {
445  public:
450  };
451 
453  {
454  public:
458  };
459 
461  {
462  public:
466  };
467 
469  {
470  public:
474  };
475 
477  {
478  public:
482  };
483 
485  {
486  public:
491  };
492 
494  {
495  public:
499  };
500 
502  {
503  public:
507  };
508 
510  {
511  public:
515  };
516 
518  {
519  public:
522  };
523 
525  {
526  public:
530  };
531 
533  {
534  public:
537  };
538 
540  {
541  public:
544  };
545 
562 
571  };
572 }
573 
575 
577 
578 #endif
static uint hash(const uchar *p, int n)
Definition: qhash.cpp:68
QVector< ElementType > m_elementTypes
QHash< AtomicValue::Ptr, NamespaceSupport > m_enumerationFacetValues
int type
Definition: qmetatype.cpp:239
void addSubstitutionGroupAffiliation(const XsdElement::Ptr &element, const QList< QXmlName > &elementName, const QSourceLocation &location)
void resolveTermReference(const XsdParticle::Ptr &particle, QSet< QXmlName > visitedGroups)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
void addSimpleListType(const XsdSimpleType::Ptr &simpleType, const QXmlName &typeName, const QSourceLocation &location)
QVector< SimpleListType > m_simpleListTypes
void addRedefinedAttributeGroups(const XsdAttributeGroup::Ptr &redefinedGroup, const XsdAttributeGroup::Ptr &group)
QVector< AlternativeType > m_alternativeTypes
QVector< SimpleRestrictionBase > m_simpleRestrictionBases
QSet< XsdReference::Ptr > m_allGroups
QVector< ComplexBaseType > m_complexBaseTypes
QVector< SimpleUnionType > m_simpleUnionTypes
XsdComplexType::OpenContent::Ptr m_defaultOpenContent
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
QVector< RedefinedAttributeGroups > m_redefinedAttributeGroups
QExplicitlySharedDataPointer< XsdSchemaContext > m_context
void addKeyReference(const XsdElement::Ptr &element, const XsdIdentityConstraint::Ptr &keyRef, const QXmlName &name, const QSourceLocation &location)
void setDefaultOpenContent(const XsdComplexType::OpenContent::Ptr &openContent, bool appliesToEmpty)
void addRedefinedGroups(const XsdModelGroup::Ptr &redefinedGroup, const XsdModelGroup::Ptr &group)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
Encapsulates the resolving of type/element references in a schema after parsing has finished...
QHash< NamedSchemaComponent::Ptr, QSourceLocation > m_componentLocationHash
const char * typeName
Definition: qmetatype.cpp:239
void addAllGroupCheck(const XsdReference::Ptr &reference)
const char * name
XsdFacet::Hash complexTypeFacets(const XsdComplexType::Ptr &complexType) const
The namespace for the internal API of QtXmlPatterns.
The QSourceLocation class identifies a location in a resource by URI, line, and column.
QSourceLocation sourceLocation(const NamedSchemaComponent::Ptr component) const
QVector< KeyReference > m_keyReferences
void addComplexBaseType(const XsdComplexType::Ptr &complexType, const QXmlName &baseName, const QSourceLocation &location, const XsdFacet::Hash &facets=XsdFacet::Hash())
static qreal component(const QPointF &point, unsigned int i)
void addSubstitutionGroupType(const XsdElement::Ptr &element)
A helper class for handling nested namespace declarations.
QXmlName baseTypeNameOfType(const SchemaType::Ptr &type) const
void copyDataTo(const XsdSchemaResolver::Ptr &other) const
QXmlName typeNameOfAttribute(const XsdAttribute::Ptr &attribute) const
void addEnumerationFacetValue(const AtomicValue::Ptr &facetValue, const NamespaceSupport &namespaceSupport)
void addComponentLocationHash(const QHash< NamedSchemaComponent::Ptr, QSourceLocation > &hash)
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
XsdSchemaResolver(const QExplicitlySharedDataPointer< XsdSchemaContext > &context, const XsdSchemaParserContext *parserContext)
The QSharedData class is a base class for shared data objects.
Definition: qshareddata.h:56
void removeSimpleRestrictionBase(const XsdSimpleType::Ptr &type)
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63
AnySimpleType::Ptr findPrimitiveType(const AnySimpleType::Ptr &type, QSet< AnySimpleType::Ptr > &visitedTypes)
QExplicitlySharedDataPointer< XsdSchemaChecker > m_checker
QExplicitlySharedDataPointer< XsdSchemaResolver > Ptr
void addAttributeType(const XsdAttribute::Ptr &attribute, const QXmlName &typeName, const QSourceLocation &location)
void addElementType(const XsdElement::Ptr &element, const QXmlName &typeName, const QSourceLocation &location)
QVector< ComplexContentType > m_complexContentTypes
QVector< AlternativeTypeElement > m_alternativeTypeElements
void addSimpleUnionTypes(const XsdSimpleType::Ptr &simpleType, const QList< QXmlName > &typeNames, const QSourceLocation &location)
QVector< XsdElement::Ptr > m_substitutionGroupTypes
void removeComplexBaseType(const XsdComplexType::Ptr &type)
#define QT_END_HEADER
Definition: qglobal.h:137
void addAlternativeType(const XsdAlternative::Ptr &alternative, const QXmlName &typeName, const QSourceLocation &location)
QVector< AttributeType > m_attributeTypes
void addComplexContentType(const XsdComplexType::Ptr &complexType, const XsdParticle::Ptr &content, bool mixed)
QVector< RedefinedGroups > m_redefinedGroups
void addSimpleRestrictionBase(const XsdSimpleType::Ptr &simpleType, const QXmlName &baseName, const QSourceLocation &location)
QVector< SubstitutionGroupAffiliation > m_substitutionGroupAffiliations