Qt 4.8
Public Types | Public Functions | Properties | List of all members
QPatternist::XsdSchema Class Reference

Represents a XSD schema object. More...

#include <qxsdschema_p.h>

Inheritance diagram for QPatternist::XsdSchema:
QSharedData QPatternist::XsdAnnotated

Public Types

typedef QList< XsdSchema::PtrList
 
typedef QExplicitlySharedDataPointer< XsdSchemaPtr
 

Public Functions

void addAnonymousType (const SchemaType::Ptr &type)
 
void addAttribute (const XsdAttribute::Ptr &attribute)
 
void addAttributeGroup (const XsdAttributeGroup::Ptr &group)
 
void addElement (const XsdElement::Ptr &element)
 
void addElementGroup (const XsdModelGroup::Ptr &group)
 
void addIdentityConstraint (const XsdIdentityConstraint::Ptr &constraint)
 
void addNotation (const XsdNotation::Ptr &notation)
 
void addType (const SchemaType::Ptr &type)
 
SchemaType::List anonymousTypes () const
 
XsdAttribute::Ptr attribute (const QXmlName &name) const
 
XsdAttributeGroup::Ptr attributeGroup (const QXmlName name) const
 
XsdAttributeGroup::List attributeGroups () const
 
XsdAttribute::List attributes () const
 
XsdComplexType::List complexTypes () const
 
XsdElement::Ptr element (const QXmlName &name) const
 
XsdModelGroup::Ptr elementGroup (const QXmlName &name) const
 
XsdModelGroup::List elementGroups () const
 
XsdElement::List elements () const
 
XsdIdentityConstraint::Ptr identityConstraint (const QXmlName &name) const
 
XsdIdentityConstraint::List identityConstraints () const
 
NamePool::Ptr namePool () const
 
XsdNotation::Ptr notation (const QXmlName &name) const
 
XsdNotation::List notations () const
 
void setTargetNamespace (const QString &targetNamespace)
 
XsdSimpleType::List simpleTypes () const
 
QString targetNamespace () const
 
SchemaType::Ptr type (const QXmlName &name) const
 
SchemaType::List types () const
 
 XsdSchema (const NamePool::Ptr &namePool)
 
 ~XsdSchema ()
 
- 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...
 
- Public Functions inherited from QPatternist::XsdAnnotated
void addAnnotation (const XsdAnnotation::Ptr &annotation)
 
void addAnnotations (const XsdAnnotation::List &annotations)
 
XsdAnnotation::List annotations () const
 

Properties

QHash< QXmlName, SchemaType::Ptrm_anonymousTypes
 
QHash< QXmlName, XsdAttributeGroup::Ptrm_attributeGroups
 
QHash< QXmlName, XsdAttribute::Ptrm_attributes
 
QHash< QXmlName, XsdModelGroup::Ptrm_elementGroups
 
QHash< QXmlName, XsdElement::Ptrm_elements
 
QHash< QXmlName, XsdIdentityConstraint::Ptrm_identityConstraints
 
QReadWriteLock m_lock
 
NamePool::Ptr m_namePool
 
QHash< QXmlName, XsdNotation::Ptrm_notations
 
QString m_targetNamespace
 
QHash< QXmlName, SchemaType::Ptrm_types
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents a XSD schema object.

The class provides access to all components of a parsed XSD.

Note
In the documentation of this class objects, which are direct children of the schema object, are called top-level objects.
See also
XML Schema API reference
Author
Tobias Koenig tobia.nosp@m.s.ko.nosp@m.enig@.nosp@m.noki.nosp@m.a.com

Definition at line 91 of file qxsdschema_p.h.

Typedefs

◆ List

Definition at line 95 of file qxsdschema_p.h.

◆ Ptr

Definition at line 94 of file qxsdschema_p.h.

Constructors and Destructors

◆ XsdSchema()

XsdSchema::XsdSchema ( const NamePool::Ptr namePool)

Creates a new schema object.

Parameters
namePoolThe namepool that should be used for names of all schema components.

Definition at line 51 of file qxsdschema.cpp.

52  : m_namePool(namePool)
53 {
54 }
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283

◆ ~XsdSchema()

XsdSchema::~XsdSchema ( )

Destroys the schema object.

Definition at line 56 of file qxsdschema.cpp.

57 {
58 }

Functions

◆ addAnonymousType()

void XsdSchema::addAnonymousType ( const SchemaType::Ptr type)

Adds an anonymous type to the schema. Anonymous types have no name and are declared locally inside an element object.

Parameters
typeThe new anonymous type.

Definition at line 168 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addAnonymousType(), QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes().

169 {
170  const QWriteLocker locker(&m_lock);
171 
172  // search for not used anonymous type name
173  QXmlName typeName = type->name(m_namePool);
174  while (m_anonymousTypes.contains(typeName)) {
175  typeName = m_namePool->allocateQName(QString(), QLatin1String("merged_") + m_namePool->stringForLocalName(typeName.localName()), QString());
176  }
177 
178  m_anonymousTypes.insert(typeName, type);
179 }
const QString & stringForLocalName(const QXmlName::LocalNameCode code) const
Definition: qnamepool_p.h:168
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
const char * typeName
Definition: qmetatype.cpp:239
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QString localName(const QXmlNamePool &query) const
Returns the local name.
Definition: qxmlname.cpp:387
The QXmlName class represents the name of an XML node, in an efficient, namespace-aware way...
Definition: qxmlname.h:58
QXmlName allocateQName(const QString &uri, const QString &localName, const QString &prefix=QString())
Definition: qnamepool.cpp:251
QHash< QXmlName, SchemaType::Ptr > m_anonymousTypes
Definition: qxsdschema_p.h:288
virtual QXmlName name(const NamePool::Ptr &np) const =0
Returns the name of the type.
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addAttribute()

void XsdSchema::addAttribute ( const XsdAttribute::Ptr attribute)

Adds a new top-level attribute to the schema.

Parameters
attributeThe new attribute.
See also
Attribute Declaration

Definition at line 96 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addAttribute(), and QPatternist::XsdSchemaMerger::merge().

97 {
98  const QWriteLocker locker(&m_lock);
99 
100  m_attributes.insert(attribute->name(m_namePool), attribute);
101 }
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
QHash< QXmlName, XsdAttribute::Ptr > m_attributes
Definition: qxsdschema_p.h:286
virtual QXmlName name(const NamePool::Ptr &namePool) const
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
XsdAttribute::Ptr attribute(const QXmlName &name) const
Definition: qxsdschema.cpp:103
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addAttributeGroup()

void XsdSchema::addAttributeGroup ( const XsdAttributeGroup::Ptr group)

Adds a new top-level attribute group to the schema.

Parameters
groupThe new attribute group.
See also
Attribute Group Declaration

Definition at line 188 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addAttributeGroup(), and QPatternist::XsdSchemaMerger::merge().

189 {
190  const QWriteLocker locker(&m_lock);
191 
192  m_attributeGroups.insert(group->name(m_namePool), group);
193 }
QHash< QXmlName, XsdAttributeGroup::Ptr > m_attributeGroups
Definition: qxsdschema_p.h:289
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
virtual QXmlName name(const NamePool::Ptr &namePool) const
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addElement()

void XsdSchema::addElement ( const XsdElement::Ptr element)

Adds a new top-level element to the schema.

Parameters
elementThe new element.
See also
Element Declaration

Definition at line 75 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addElement(), and QPatternist::XsdSchemaMerger::merge().

76 {
77  const QWriteLocker locker(&m_lock);
78 
79  m_elements.insert(element->name(m_namePool), element);
80 }
XsdElement::Ptr element(const QXmlName &name) const
Definition: qxsdschema.cpp:82
QHash< QXmlName, XsdElement::Ptr > m_elements
Definition: qxsdschema_p.h:285
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
virtual QXmlName name(const NamePool::Ptr &namePool) const
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addElementGroup()

void XsdSchema::addElementGroup ( const XsdModelGroup::Ptr group)

Adds a new top-level element group to the schema.

Parameters
groupThe new element group.
See also
Element Group Declaration

Definition at line 209 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addElementGroup(), and QPatternist::XsdSchemaMerger::merge().

210 {
211  const QWriteLocker locker(&m_lock);
212 
213  m_elementGroups.insert(group->name(m_namePool), group);
214 }
QHash< QXmlName, XsdModelGroup::Ptr > m_elementGroups
Definition: qxsdschema_p.h:290
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
virtual QXmlName name(const NamePool::Ptr &namePool) const
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addIdentityConstraint()

void XsdSchema::addIdentityConstraint ( const XsdIdentityConstraint::Ptr constraint)

Adds a new identity constraint to the schema.

Definition at line 251 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addIdentityConstraint(), and QPatternist::XsdSchemaMerger::merge().

252 {
253  const QWriteLocker locker(&m_lock);
254 
255  m_identityConstraints.insert(constraint->name(m_namePool), constraint);
256 }
QHash< QXmlName, XsdIdentityConstraint::Ptr > m_identityConstraints
Definition: qxsdschema_p.h:292
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
virtual QXmlName name(const NamePool::Ptr &namePool) const
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addNotation()

void XsdSchema::addNotation ( const XsdNotation::Ptr notation)

Adds a new top-level notation to the schema.

Parameters
notationThe new notation.
See also
Notation Declaration

Definition at line 230 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addNotation(), and QPatternist::XsdSchemaMerger::merge().

231 {
232  const QWriteLocker locker(&m_lock);
233 
234  m_notations.insert(notation->name(m_namePool), notation);
235 }
QHash< QXmlName, XsdNotation::Ptr > m_notations
Definition: qxsdschema_p.h:291
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
XsdNotation::Ptr notation(const QXmlName &name) const
Definition: qxsdschema.cpp:237
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ addType()

void XsdSchema::addType ( const SchemaType::Ptr type)

Adds a new top-level type to the schema. That can be a simple or a complex type.

Parameters
typeThe new type.
See also
Simple Type Declaration
Complex Type Declaration

Definition at line 117 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addType(), and QPatternist::XsdSchemaMerger::merge().

118 {
119  const QWriteLocker locker(&m_lock);
120 
121  m_types.insert(type->name(m_namePool), type);
122 }
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283
QHash< QXmlName, SchemaType::Ptr > m_types
Definition: qxsdschema_p.h:287
SchemaType::Ptr type(const QXmlName &name) const
Definition: qxsdschema.cpp:124
The QWriteLocker class is a convenience class that simplifies locking and unlocking read-write locks ...
virtual QXmlName name(const NamePool::Ptr &np) const =0
Returns the name of the type.
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ anonymousTypes()

SchemaType::List XsdSchema::anonymousTypes ( ) const

Returns the list of all anonymous types.

Definition at line 181 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkAttributeConstraints(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkBasicCircularInheritances(), QPatternist::XsdSchemaChecker::checkBasicComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkBasicSimpleTypeConstraints(), QPatternist::XsdSchemaChecker::checkCircularInheritances(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkDuplicatedAttributeUses(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleDerivationRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), collectAllElements(), QPatternist::XsdSchemaDebugger::dumpSchema(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveAttributeTermReferences(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveEnumerationFacetValues(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictions(), and QPatternist::XsdSchemaResolver::resolveTermReferences().

182 {
183  const QReadLocker locker(&m_lock);
184 
185  return m_anonymousTypes.values();
186 }
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QList< T > values() const
Returns a list containing all the values in the hash, in an arbitrary order.
Definition: qhash.h:693
QHash< QXmlName, SchemaType::Ptr > m_anonymousTypes
Definition: qxsdschema_p.h:288
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ attribute()

XsdAttribute::Ptr XsdSchema::attribute ( const QXmlName name) const

Returns the top-level attribute of the schema with the given name or an empty pointer if none exist.

Definition at line 103 of file qxsdschema.cpp.

Referenced by addAttribute(), QPatternist::XsdSchemaParser::addAttribute(), QPatternist::XsdValidatingInstanceReader::attributeByName(), QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaResolver::resolveAttributeTermReferences().

104 {
105  const QReadLocker locker(&m_lock);
106 
107  return m_attributes.value(name);
108 }
QHash< QXmlName, XsdAttribute::Ptr > m_attributes
Definition: qxsdschema_p.h:286
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ attributeGroup()

XsdAttributeGroup::Ptr XsdSchema::attributeGroup ( const QXmlName  name) const

Returns the top-level attribute group of the schema with the given name or an empty pointer if none exist.

Definition at line 195 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addAttributeGroup(), QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaResolver::resolveAttributeTermReferences().

196 {
197  const QReadLocker locker(&m_lock);
198 
199  return m_attributeGroups.value(name);
200 }
QHash< QXmlName, XsdAttributeGroup::Ptr > m_attributeGroups
Definition: qxsdschema_p.h:289
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ attributeGroups()

XsdAttributeGroup::List XsdSchema::attributeGroups ( ) const

Returns the list of all top-level attribute groups.

Definition at line 202 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkDuplicatedAttributeUses(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaParser::parseRedefine(), and QPatternist::XsdSchemaResolver::resolveAttributeTermReferences().

203 {
204  const QReadLocker locker(&m_lock);
205 
206  return m_attributeGroups.values();
207 }
QHash< QXmlName, XsdAttributeGroup::Ptr > m_attributeGroups
Definition: qxsdschema_p.h:289
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ attributes()

XsdAttribute::List XsdSchema::attributes ( ) const

Returns the list of all top-level attributes.

Definition at line 110 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkAttributeConstraints(), QPatternist::XsdSchemaDebugger::dumpSchema(), QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaParser::parseRedefine().

111 {
112  const QReadLocker locker(&m_lock);
113 
114  return m_attributes.values();
115 }
QHash< QXmlName, XsdAttribute::Ptr > m_attributes
Definition: qxsdschema_p.h:286
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ complexTypes()

XsdComplexType::List XsdSchema::complexTypes ( ) const

Returns the list of all top-level complex types.

Definition at line 153 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::parseRedefine().

154 {
155  QReadLocker locker(&m_lock);
156 
157  XsdComplexType::List retval;
158 
160  for (int i = 0; i < types.count(); ++i) {
161  if (types.at(i)->isComplexType() && types.at(i)->isDefinedBySchema())
162  retval.append(types.at(i));
163  }
164 
165  return retval;
166 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
virtual bool isComplexType() const
Definition: qschematype.cpp:70
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QHash< QXmlName, SchemaType::Ptr > m_types
Definition: qxsdschema_p.h:287
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QList< T > values() const
Returns a list containing all the values in the hash, in an arbitrary order.
Definition: qhash.h:693
QList< SchemaType::Ptr > List
Definition: qschematype_p.h:84
virtual bool isDefinedBySchema() const
Definition: qschematype.cpp:75
SchemaType::List types() const
Definition: qxsdschema.cpp:131
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ element()

XsdElement::Ptr XsdSchema::element ( const QXmlName name) const

Returns the top-level element of the schema with the given name or an empty pointer if none exist.

Definition at line 82 of file qxsdschema.cpp.

Referenced by addElement(), QPatternist::XsdSchemaParser::addElement(), QPatternist::XsdValidatingInstanceReader::elementByName(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaResolver::resolveSubstitutionGroupAffiliations(), and QPatternist::XsdSchemaResolver::resolveTermReference().

83 {
84  const QReadLocker locker(&m_lock);
85 
86  return m_elements.value(name);
87 }
QHash< QXmlName, XsdElement::Ptr > m_elements
Definition: qxsdschema_p.h:285
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ elementGroup()

XsdModelGroup::Ptr XsdSchema::elementGroup ( const QXmlName name) const

Returns the top-level element group of the schema with the given name or an empty pointer if none exist.

Definition at line 216 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addElementGroup(), QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaResolver::resolveTermReference().

217 {
218  const QReadLocker locker(&m_lock);
219 
220  return m_elementGroups.value(name);
221 }
QHash< QXmlName, XsdModelGroup::Ptr > m_elementGroups
Definition: qxsdschema_p.h:290
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ elementGroups()

XsdModelGroup::List XsdSchema::elementGroups ( ) const

Returns the list of all top-level element groups.

Definition at line 223 of file qxsdschema.cpp.

Referenced by collectAllElements(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaParser::parseRedefine(), and QPatternist::XsdSchemaResolver::resolveTermReferences().

224 {
225  const QReadLocker locker(&m_lock);
226 
227  return m_elementGroups.values();
228 }
QHash< QXmlName, XsdModelGroup::Ptr > m_elementGroups
Definition: qxsdschema_p.h:290
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ elements()

XsdElement::List XsdSchema::elements ( ) const

Returns the list of all top-level elements.

Definition at line 89 of file qxsdschema.cpp.

Referenced by collectAllElements(), QPatternist::XsdSchemaDebugger::dumpSchema(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaParser::parseRedefine(), and QPatternist::XsdSchemaResolver::resolveSubstitutionGroups().

90 {
91  const QReadLocker locker(&m_lock);
92 
93  return m_elements.values();
94 }
QHash< QXmlName, XsdElement::Ptr > m_elements
Definition: qxsdschema_p.h:285
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ identityConstraint()

XsdIdentityConstraint::Ptr XsdSchema::identityConstraint ( const QXmlName name) const

Returns the identity constraint with the given name or an empty pointer if none exist.

Definition at line 258 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::addIdentityConstraint(), QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaResolver::resolveKeyReferences().

259 {
260  const QReadLocker locker(&m_lock);
261 
262  return m_identityConstraints.value(name);
263 }
QHash< QXmlName, XsdIdentityConstraint::Ptr > m_identityConstraints
Definition: qxsdschema_p.h:292
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ identityConstraints()

XsdIdentityConstraint::List XsdSchema::identityConstraints ( ) const

Returns the list of all identity constraints in this schema.

Definition at line 265 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaMerger::merge().

266 {
267  const QReadLocker locker(&m_lock);
268 
269  return m_identityConstraints.values();
270 }
QHash< QXmlName, XsdIdentityConstraint::Ptr > m_identityConstraints
Definition: qxsdschema_p.h:292
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ namePool()

NamePool::Ptr XsdSchema::namePool ( ) const

Returns the namepool that is used for names of all schema components.

Definition at line 60 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaMerger::merge().

61 {
62  return m_namePool;
63 }
NamePool::Ptr m_namePool
Definition: qxsdschema_p.h:283

◆ notation()

XsdNotation::Ptr XsdSchema::notation ( const QXmlName name) const

Returns the top-level notation of the schema with the given name or an empty pointer if none exist.

Definition at line 237 of file qxsdschema.cpp.

Referenced by addNotation(), QPatternist::XsdSchemaParser::addNotation(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), and QPatternist::XsdSchemaMerger::merge().

238 {
239  const QReadLocker locker(&m_lock);
240 
241  return m_notations.value(name);
242 }
QHash< QXmlName, XsdNotation::Ptr > m_notations
Definition: qxsdschema_p.h:291
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ notations()

XsdNotation::List XsdSchema::notations ( ) const

Returns the list of all top-level notations.

Definition at line 244 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaMerger::merge(), and QPatternist::XsdSchemaParser::parseRedefine().

245 {
246  const QReadLocker locker(&m_lock);
247 
248  return m_notations.values();
249 }
QHash< QXmlName, XsdNotation::Ptr > m_notations
Definition: qxsdschema_p.h:291
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ setTargetNamespace()

void XsdSchema::setTargetNamespace ( const QString targetNamespace)

Sets the targetNamespace of the schema.

Definition at line 65 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::parseSchema().

66 {
68 }
QString targetNamespace() const
Definition: qxsdschema.cpp:70

◆ simpleTypes()

XsdSimpleType::List XsdSchema::simpleTypes ( ) const

Returns the list of all top-level simple types.

Definition at line 138 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaParser::parseRedefine().

139 {
140  QReadLocker locker(&m_lock);
141 
142  XsdSimpleType::List retval;
143 
145  for (int i = 0; i < types.count(); ++i) {
146  if (types.at(i)->isSimpleType() && types.at(i)->isDefinedBySchema())
147  retval.append(types.at(i));
148  }
149 
150  return retval;
151 }
virtual bool isSimpleType() const
Definition: qschematype.cpp:56
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QHash< QXmlName, SchemaType::Ptr > m_types
Definition: qxsdschema_p.h:287
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QList< AnySimpleType::Ptr > List
QList< T > values() const
Returns a list containing all the values in the hash, in an arbitrary order.
Definition: qhash.h:693
virtual bool isDefinedBySchema() const
Definition: qschematype.cpp:75
SchemaType::List types() const
Definition: qxsdschema.cpp:131
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ targetNamespace()

QString XsdSchema::targetNamespace ( ) const

Returns the target namespace of the schema.

Definition at line 70 of file qxsdschema.cpp.

Referenced by QPatternist::XsdValidatingInstanceReader::addSchema(), and setTargetNamespace().

71 {
72  return m_targetNamespace;
73 }

◆ type()

SchemaType::Ptr XsdSchema::type ( const QXmlName name) const

Returns the top-level type of the schema with the given name or an empty pointer if none exist.

Definition at line 124 of file qxsdschema.cpp.

Referenced by addType(), QPatternist::XsdSchemaParser::addType(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaResolver::resolveAlternativeTypes(), QPatternist::XsdSchemaResolver::resolveAttributeTypes(), QPatternist::XsdSchemaResolver::resolveComplexBaseTypes(), QPatternist::XsdSchemaResolver::resolveElementTypes(), QPatternist::XsdSchemaResolver::resolveSimpleListType(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictionBaseTypes(), QPatternist::XsdSchemaResolver::resolveSimpleUnionTypes(), and QPatternist::XsdValidatingInstanceReader::typeByName().

125 {
126  const QReadLocker locker(&m_lock);
127 
128  return m_types.value(name);
129 }
const T value(const Key &key) const
Returns the value associated with the key.
Definition: qhash.h:606
QHash< QXmlName, SchemaType::Ptr > m_types
Definition: qxsdschema_p.h:287
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

◆ types()

SchemaType::List XsdSchema::types ( ) const

Returns the list of all top-level types.

Definition at line 131 of file qxsdschema.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkAttributeConstraints(), QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), QPatternist::XsdSchemaChecker::checkBasicCircularInheritances(), QPatternist::XsdSchemaChecker::checkBasicComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkBasicSimpleTypeConstraints(), QPatternist::XsdSchemaChecker::checkCircularInheritances(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkDuplicatedAttributeUses(), QPatternist::XsdSchemaChecker::checkElementDuplicates(), QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleDerivationRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), collectAllElements(), complexTypes(), QPatternist::XsdSchemaDebugger::dumpSchema(), QPatternist::XsdSchemaMerger::merge(), QPatternist::XsdSchemaResolver::resolveAttributeInheritance(), QPatternist::XsdSchemaResolver::resolveAttributeTermReferences(), QPatternist::XsdSchemaResolver::resolveComplexContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveEnumerationFacetValues(), QPatternist::XsdSchemaResolver::resolveSimpleContentComplexTypes(), QPatternist::XsdSchemaResolver::resolveSimpleRestrictions(), QPatternist::XsdSchemaResolver::resolveTermReferences(), and simpleTypes().

132 {
133  const QReadLocker locker(&m_lock);
134 
135  return m_types.values();
136 }
QHash< QXmlName, SchemaType::Ptr > m_types
Definition: qxsdschema_p.h:287
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
QList< T > values() const
Returns a list containing all the values in the hash, in an arbitrary order.
Definition: qhash.h:693
QReadWriteLock m_lock
Definition: qxsdschema_p.h:293

Properties

◆ m_anonymousTypes

QHash<QXmlName, SchemaType::Ptr> QPatternist::XsdSchema::m_anonymousTypes
private

Definition at line 288 of file qxsdschema_p.h.

Referenced by addAnonymousType(), and anonymousTypes().

◆ m_attributeGroups

QHash<QXmlName, XsdAttributeGroup::Ptr> QPatternist::XsdSchema::m_attributeGroups
private

Definition at line 289 of file qxsdschema_p.h.

Referenced by addAttributeGroup(), attributeGroup(), and attributeGroups().

◆ m_attributes

QHash<QXmlName, XsdAttribute::Ptr> QPatternist::XsdSchema::m_attributes
private

Definition at line 286 of file qxsdschema_p.h.

Referenced by addAttribute(), attribute(), and attributes().

◆ m_elementGroups

QHash<QXmlName, XsdModelGroup::Ptr> QPatternist::XsdSchema::m_elementGroups
private

Definition at line 290 of file qxsdschema_p.h.

Referenced by addElementGroup(), elementGroup(), and elementGroups().

◆ m_elements

QHash<QXmlName, XsdElement::Ptr> QPatternist::XsdSchema::m_elements
private

Definition at line 285 of file qxsdschema_p.h.

Referenced by addElement(), element(), and elements().

◆ m_identityConstraints

QHash<QXmlName, XsdIdentityConstraint::Ptr> QPatternist::XsdSchema::m_identityConstraints
private

Definition at line 292 of file qxsdschema_p.h.

Referenced by addIdentityConstraint(), identityConstraint(), and identityConstraints().

◆ m_lock

QReadWriteLock QPatternist::XsdSchema::m_lock
mutableprivate

◆ m_namePool

NamePool::Ptr QPatternist::XsdSchema::m_namePool
private

◆ m_notations

QHash<QXmlName, XsdNotation::Ptr> QPatternist::XsdSchema::m_notations
private

Definition at line 291 of file qxsdschema_p.h.

Referenced by addNotation(), notation(), and notations().

◆ m_targetNamespace

QString QPatternist::XsdSchema::m_targetNamespace
private

Definition at line 284 of file qxsdschema_p.h.

Referenced by setTargetNamespace(), and targetNamespace().

◆ m_types

QHash<QXmlName, SchemaType::Ptr> QPatternist::XsdSchema::m_types
private

Definition at line 287 of file qxsdschema_p.h.

Referenced by addType(), complexTypes(), simpleTypes(), type(), and types().


The documentation for this class was generated from the following files: