Qt 4.8
Public Types | Public Functions | Public Variables | Private Functions | Properties | List of all members
QPatternist::XsdSchemaContext Class Reference

A context for schema parsing and validation. More...

#include <qxsdschemacontext_p.h>

Inheritance diagram for QPatternist::XsdSchemaContext:
QPatternist::ReportContext QSharedData

Public Types

typedef QExplicitlySharedDataPointer< XsdSchemaContextPtr
 
- Public Types inherited from QPatternist::ReportContext
enum  ErrorCode {
  XSDError, XPST0001, XPDY0002, XPST0003,
  XPTY0004, XPST0005, XPTY0006, XPTY0007,
  XPST0008, XQST0009, XPST0010, XQST0012,
  XQST0013, XQST0014, XQST0015, XQST0016,
  XPST0017, XPTY0018, XPTY0019, XPTY0020,
  XPDY0021, XQST0022, XQTY0023, XQTY0024,
  XQDY0025, XQDY0026, XQDY0027, XQTY0028,
  XQDY0029, XQTY0030, XQST0031, XQST0032,
  XQST0033, XQST0034, XQST0035, XQST0036,
  XQST0037, XQST0038, XQST0039, XQST0040,
  XQDY0041, XQST0042, XQST0043, XQDY0044,
  XQST0045, XQST0046, XQST0047, XQST0048,
  XQST0049, XPDY0050, XPST0051, XQDY0052,
  XQST0053, XQST0054, XQST0055, XQST0056,
  XQST0057, XQST0058, XQST0059, XQST0060,
  XQDY0061, XQDY0062, XQST0063, XQDY0064,
  XQST0065, XQST0066, XQST0067, XQST0068,
  XQST0069, XQST0070, XQST0071, XQDY0072,
  XQST0073, XQDY0074, XQST0075, XQST0076,
  XQST0077, XQST0078, XQST0079, XPST0080,
  XPST0081, XQST0082, XPST0083, XQDY0084,
  XQST0085, XQTY0086, XQST0087, XQST0088,
  XQST0089, XQST0090, XQDY0091, XQDY0092,
  XQST0093, FOER0000, FOAR0001, FOAR0002,
  FOCA0001, FOCA0002, FOCA0003, FOCA0005,
  FOCA0006, FOCH0001, FOCH0002, FOCH0003,
  FOCH0004, FODC0001, FODC0002, FODC0003,
  FODC0004, FODC0005, FODT0001, FODT0002,
  FODT0003, FONS0004, FONS0005, FORG0001,
  FORG0002, FORG0003, FORG0004, FORG0005,
  FORG0006, FORG0008, FORG0009, FORX0001,
  FORX0002, FORX0003, FORX0004, FOTY0012,
  SENR0001, SERE0003, SEPM0004, SERE0005,
  SERE0006, SESU0007, SERE0008, SEPM0009,
  SEPM0010, SESU0011, SERE0012, SESU0013,
  SERE0014, SERE0015, SEPM0016, XTSE0010,
  XTSE0020, XTSE0080, XTSE0090, XTSE0110,
  XTSE0120, XTSE0125, XTSE0130, XTSE0150,
  XTSE0165, XTSE0170, XTSE0180, XTSE0190,
  XTSE0200, XTSE0210, XTSE0215, XTSE0220,
  XTSE0260, XTSE0265, XTSE0280, XTSE0340,
  XTSE0350, XTSE0370, XTSE0500, XTSE0530,
  XTSE0550, XTSE0580, XTSE0620, XTSE0630,
  XTSE0650, XTSE0660, XTSE0670, XTSE0680,
  XTSE0690, XTSE0710, XTSE0720, XTSE0740,
  XTSE0760, XTSE0770, XTSE0805, XTSE0808,
  XTSE0809, XTSE0810, XTSE0812, XTSE0840,
  XTSE0870, XTSE0880, XTSE0910, XTSE0940,
  XTTE0950, XTSE0975, XTSE1015, XTSE1017,
  XTSE1040, XTSE1060, XTSE1070, XTSE1080,
  XTSE1090, XTSE1130, XTSE1205, XTSE1210,
  XTSE1220, XTSE1290, XTSE1295, XTSE1300,
  XTSE1430, XTSE1505, XTSE1520, XTSE1530,
  XTSE1560, XTSE1570, XTSE1580, XTSE1590,
  XTSE1600, XTSE1650, XTSE1660, XTTE0505,
  XTTE0510, XTTE0520, XTTE0570, XTTE0590,
  XTTE0600, XTTE0780, XTTE0790, XTTE0990,
  XTTE1000, XTTE1020, XTTE1100, XTTE1120,
  XTTE1510, XTTE1512, XTTE1515, XTTE1540,
  XTTE1545, XTTE1550, XTTE1555, XTDE0030,
  XTDE0040, XTDE0045, XTDE0047, XTDE0050,
  XTDE0060, XTDE0160, XTRE0270, XTDE0290,
  XTDE0410, XTDE0420, XTDE0430, XTDE0440,
  XTDE0485, XTRE0540, XTDE0560, XTDE0610,
  XTDE0640, XTDE0700, XTRE0795, XTDE0820,
  XTDE0830, XTDE0835, XTDE0850, XTDE0855,
  XTDE0860, XTDE0865, XTDE0890, XTDE0905,
  XTDE0920, XTDE0925, XTDE0930, XTDE0980,
  XTDE1030, XTDE1035, XTDE1110, XTDE1140,
  XTDE1145, XTDE1150, XTRE1160, XTDE1170,
  XTDE1190, XTDE1200, XTDE1260, XTDE1270,
  XTDE1280, XTDE1310, XTDE1340, XTDE1350,
  XTDE1360, XTDE1370, XTDE1380, XTDE1390,
  XTMM9000, XTDE1400, XTDE1420, XTDE1425,
  XTDE1428, XTDE1440, XTDE1450, XTDE1460,
  XTDE1480, XTDE1490, XTRE1495, XTRE1500,
  XTRE1620, XTRE1630, XTDE1665
}
 
typedef QHash< const SourceLocationReflection *, QSourceLocationLocationHash
 
typedef QExplicitlySharedDataPointer< ReportContextPtr
 

Public Functions

virtual QUrl baseURI () const
 
XsdFacet::Hash facetsForType (const AnySimpleType::Ptr &type) const
 
virtual QSourceLocation locationFor (const SourceLocationReflection *const reflection) const
 
virtual QAbstractMessageHandlermessageHandler () const
 
virtual NamePool::Ptr namePool () const
 
virtual QNetworkAccessManagernetworkAccessManager () const
 
SchemaTypeFactory::Ptr schemaTypeFactory () const
 
virtual void setBaseURI (const QUrl &uri)
 
void setMessageHandler (QAbstractMessageHandler *handler)
 
void setNetworkAccessManager (QNetworkAccessManager *accessManager)
 
void setUriResolver (const QAbstractUriResolver *resolver)
 
virtual const QAbstractUriResolveruriResolver () const
 
 XsdSchemaContext (const NamePool::Ptr &namePool)
 
- Public Functions inherited from QPatternist::ReportContext
void error (const QString &message, const ReportContext::ErrorCode errorCode, const QSourceLocation &sourceLocation)
 
void error (const QString &message, const ReportContext::ErrorCode errorCode, const SourceLocationReflection *const reflection)
 
void error (const QString &message, const QXmlName qName, const SourceLocationReflection *const r)
 
 ReportContext ()
 Default constructors. More...
 
QUrl resolveURI (const QUrl &relative, const QUrl &baseURI) const
 
void warning (const QString &message, const QSourceLocation &sourceLocation=QSourceLocation())
 
virtual ~ReportContext ()
 
- 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 Variables

QHash< SchemaType::Ptr, XsdFacet::Hashm_builtinTypesFacetList
 
SchemaTypeFactory::Ptr m_schemaTypeFactory
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Private Functions

QHash< SchemaType::Ptr, XsdFacet::HashsetupBuiltinTypesFacetList () const
 

Properties

QUrl m_baseURI
 
QAbstractMessageHandlerm_messageHandler
 
NamePool::Ptr m_namePool
 
QNetworkAccessManagerm_networkAccessManager
 
const QAbstractUriResolverm_uriResolver
 

Additional Inherited Members

- Static Public Functions inherited from QPatternist::ReportContext
static QString codeFromURI (const QString &typeURI, QString &uri)
 
static QString codeToString (const ReportContext::ErrorCode errorCode)
 

Detailed Description

A context for schema parsing and validation.

This class provides the infrastructure for error reporting and network access. Additionally it stores objects that are used by both, the parser and the validator.

Author
Tobias Koenig tobia.nosp@m.s.ko.nosp@m.enig@.nosp@m.noki.nosp@m.a.com

Definition at line 83 of file qxsdschemacontext_p.h.

Typedefs

◆ Ptr

A smart pointer wrapping XsdSchemaContext instances.

Definition at line 89 of file qxsdschemacontext_p.h.

Constructors and Destructors

◆ XsdSchemaContext()

XsdSchemaContext::XsdSchemaContext ( const NamePool::Ptr namePool)

Creates a new schema context object.

Parameters
namePoolThe name pool all names belong to.

Definition at line 52 of file qxsdschemacontext.cpp.

53  : m_namePool(namePool)
55  , m_uriResolver(0)
56  , m_messageHandler(0)
57 {
58 }
QAbstractMessageHandler * m_messageHandler
QNetworkAccessManager * m_networkAccessManager
const QAbstractUriResolver * m_uriResolver

Functions

◆ baseURI()

QUrl XsdSchemaContext::baseURI ( ) const
virtual

Returns the base URI of the main schema.

Definition at line 65 of file qxsdschemacontext.cpp.

66 {
67  return m_baseURI;
68 }

◆ facetsForType()

XsdFacet::Hash XsdSchemaContext::facetsForType ( const AnySimpleType::Ptr type) const

Returns the list of facets for the given simple type.

Definition at line 110 of file qxsdschemacontext.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkConstrainingFacets(), and QPatternist::XsdTypeChecker::mergedFacetsForType().

111 {
112  if (type->isDefinedBySchema())
113  return XsdSimpleType::Ptr(type)->facets();
114  else {
115  if (m_builtinTypesFacetList.isEmpty())
117 
118  return m_builtinTypesFacetList.value(type);
119  }
120 }
QHash< SchemaType::Ptr, XsdFacet::Hash > setupBuiltinTypesFacetList() const
XsdFacet::Hash facets() const
QHash< SchemaType::Ptr, XsdFacet::Hash > m_builtinTypesFacetList
virtual bool isDefinedBySchema() const
Definition: qschematype.cpp:75

◆ locationFor()

QSourceLocation XsdSchemaContext::locationFor ( const SourceLocationReflection *const  reflection) const
virtual

Always returns an empty source location.

Implements QPatternist::ReportContext.

Definition at line 95 of file qxsdschemacontext.cpp.

96 {
97  return QSourceLocation();
98 }
The QSourceLocation class identifies a location in a resource by URI, line, and column.

◆ messageHandler()

QAbstractMessageHandler * XsdSchemaContext::messageHandler ( ) const
virtual

Returns the message handler used by the context for error reporting.

Implements QPatternist::ReportContext.

Definition at line 90 of file qxsdschemacontext.cpp.

91 {
92  return m_messageHandler;
93 }
QAbstractMessageHandler * m_messageHandler

◆ namePool()

NamePool::Ptr XsdSchemaContext::namePool ( ) const
virtual

◆ networkAccessManager()

QNetworkAccessManager * XsdSchemaContext::networkAccessManager ( ) const
virtual

Returns the network access manager that is used to access referenced schema definitions.

Definition at line 80 of file qxsdschemacontext.cpp.

Referenced by QPatternist::XsdValidatingInstanceReader::loadSchema(), QPatternist::XsdSchemaParser::parseImport(), QPatternist::XsdSchemaParser::parseInclude(), and QPatternist::XsdSchemaParser::parseRedefine().

81 {
83 }
QNetworkAccessManager * m_networkAccessManager

◆ schemaTypeFactory()

SchemaTypeFactory::Ptr XsdSchemaContext::schemaTypeFactory ( ) const

◆ setBaseURI()

void XsdSchemaContext::setBaseURI ( const QUrl uri)
virtual

Sets the base URI for the main schema.

The main schema is the one that includes resp. imports all the other schema files.

Definition at line 70 of file qxsdschemacontext.cpp.

71 {
72  m_baseURI = uri;
73 }

◆ setMessageHandler()

void XsdSchemaContext::setMessageHandler ( QAbstractMessageHandler handler)

Sets the message handler used by the context for error reporting.

Definition at line 85 of file qxsdschemacontext.cpp.

86 {
88 }
QAbstractMessageHandler * m_messageHandler
QImageIOHandler * handler

◆ setNetworkAccessManager()

void XsdSchemaContext::setNetworkAccessManager ( QNetworkAccessManager accessManager)

Sets the network access manager that should be used to access referenced schema definitions.

Definition at line 75 of file qxsdschemacontext.cpp.

76 {
77  m_networkAccessManager = accessManager;
78 }
QNetworkAccessManager * m_networkAccessManager

◆ setupBuiltinTypesFacetList()

QHash< SchemaType::Ptr, XsdFacet::Hash > XsdSchemaContext::setupBuiltinTypesFacetList ( ) const
private

Definition at line 130 of file qxsdschemacontext.cpp.

Referenced by facetsForType().

131 {
133 
134  const XsdFacet::Ptr fixedCollapseWhiteSpace(new XsdFacet());
135  fixedCollapseWhiteSpace->setType(XsdFacet::WhiteSpace);
137  fixedCollapseWhiteSpace->setFixed(true);
138 
139  const XsdFacet::Ptr collapseWhiteSpace(new XsdFacet());
140  collapseWhiteSpace->setType(XsdFacet::WhiteSpace);
142  collapseWhiteSpace->setFixed(false);
143 
144  const XsdFacet::Ptr preserveWhiteSpace(new XsdFacet());
145  preserveWhiteSpace->setType(XsdFacet::WhiteSpace);
147  preserveWhiteSpace->setFixed(false);
148 
149  const XsdFacet::Ptr replaceWhiteSpace(new XsdFacet());
150  replaceWhiteSpace->setType(XsdFacet::WhiteSpace);
152  replaceWhiteSpace->setFixed(false);
153 
154  const XsdFacet::Ptr fixedZeroFractionDigits(new XsdFacet());
155  fixedZeroFractionDigits->setType(XsdFacet::FractionDigits);
156  fixedZeroFractionDigits->setValue(DerivedInteger<TypeNonNegativeInteger>::fromValue(m_namePool, 0));
157  fixedZeroFractionDigits->setFixed(true);
158 
159  {
160  XsdFacet::Hash &facets = hash[BuiltinTypes::xsString];
161  facets.insert(preserveWhiteSpace->type(), preserveWhiteSpace);
162  }
163 
164  {
165  XsdFacet::Hash &facets = hash[BuiltinTypes::xsBoolean];
166  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
167  }
168 
169  {
170  XsdFacet::Hash &facets = hash[BuiltinTypes::xsDecimal];
171  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
172  }
173 
174  {
175  XsdFacet::Hash &facets = hash[BuiltinTypes::xsFloat];
176  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
177  }
178 
179  {
180  XsdFacet::Hash &facets = hash[BuiltinTypes::xsDouble];
181  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
182  }
183 
184  {
186  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
187  }
188 
189  {
191  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
192  }
193 
194  {
195  XsdFacet::Hash &facets = hash[BuiltinTypes::xsTime];
196  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
197  }
198 
199  {
200  XsdFacet::Hash &facets = hash[BuiltinTypes::xsDate];
201  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
202  }
203 
204  {
206  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
207  }
208 
209  {
210  XsdFacet::Hash &facets = hash[BuiltinTypes::xsGYear];
211  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
212  }
213 
214  {
216  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
217  }
218 
219  {
220  XsdFacet::Hash &facets = hash[BuiltinTypes::xsGDay];
221  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
222  }
223 
224  {
225  XsdFacet::Hash &facets = hash[BuiltinTypes::xsGMonth];
226  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
227  }
228 
229  {
231  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
232  }
233 
234  {
236  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
237  }
238 
239  {
240  XsdFacet::Hash &facets = hash[BuiltinTypes::xsAnyURI];
241  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
242  }
243 
244  {
245  XsdFacet::Hash &facets = hash[BuiltinTypes::xsQName];
246  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
247  }
248 
249  {
251  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
252  }
253 
254  {
256  facets.insert(replaceWhiteSpace->type(), replaceWhiteSpace);
257  }
258 
259  {
260  XsdFacet::Hash &facets = hash[BuiltinTypes::xsToken];
261  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
262  }
263 
264  {
266  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
267 
268  const XsdFacet::Ptr pattern(new XsdFacet());
269  pattern->setType(XsdFacet::Pattern);
270  pattern->setMultiValue(AtomicValue::List() << DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*")));
271  facets.insert(pattern->type(), pattern);
272  }
273 
274  {
275  XsdFacet::Hash &facets = hash[BuiltinTypes::xsNMTOKEN];
276  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
277 
278  const XsdFacet::Ptr pattern(new XsdFacet());
279  pattern->setType(XsdFacet::Pattern);
281  facets.insert(pattern->type(), pattern);
282  }
283 
284  {
285  XsdFacet::Hash &facets = hash[BuiltinTypes::xsName];
286  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
287 
288  const XsdFacet::Ptr pattern(new XsdFacet());
289  pattern->setType(XsdFacet::Pattern);
291  facets.insert(pattern->type(), pattern);
292  }
293 
294  const XsdFacet::Ptr ncNamePattern(new XsdFacet());
295  {
296  ncNamePattern->setType(XsdFacet::Pattern);
297  AtomicValue::List patterns;
298  patterns << DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("\\i\\c*"));
299  patterns << DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("[\\i-[:]][\\c-[:]]*"));
300  ncNamePattern->setMultiValue(patterns);
301  }
302 
303  {
304  XsdFacet::Hash &facets = hash[BuiltinTypes::xsNCName];
305  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
306  facets.insert(ncNamePattern->type(), ncNamePattern);
307  }
308 
309  {
310  XsdFacet::Hash &facets = hash[BuiltinTypes::xsID];
311  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
312  facets.insert(ncNamePattern->type(), ncNamePattern);
313  }
314 
315  {
316  XsdFacet::Hash &facets = hash[BuiltinTypes::xsIDREF];
317  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
318  facets.insert(ncNamePattern->type(), ncNamePattern);
319  }
320 
321  {
322  XsdFacet::Hash &facets = hash[BuiltinTypes::xsENTITY];
323  facets.insert(collapseWhiteSpace->type(), collapseWhiteSpace);
324  facets.insert(ncNamePattern->type(), ncNamePattern);
325  }
326 
327  const XsdFacet::Ptr integerPattern(new XsdFacet());
328  integerPattern->setType(XsdFacet::Pattern);
329  integerPattern->setMultiValue(AtomicValue::List() << DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("[\\-+]?[0-9]+")));
330 
331  {
332  XsdFacet::Hash &facets = hash[BuiltinTypes::xsInteger];
333  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
334  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
335  facets.insert(integerPattern->type(), integerPattern);
336  }
337 
338  {
340  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
341  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
342  facets.insert(integerPattern->type(), integerPattern);
343 
344  const XsdFacet::Ptr maxInclusive(new XsdFacet());
345  maxInclusive->setType(XsdFacet::MaximumInclusive);
346  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("0")));
347  facets.insert(maxInclusive->type(), maxInclusive);
348  }
349 
350  {
352  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
353  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
354  facets.insert(integerPattern->type(), integerPattern);
355 
356  const XsdFacet::Ptr maxInclusive(new XsdFacet());
357  maxInclusive->setType(XsdFacet::MaximumInclusive);
358  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("-1")));
359  facets.insert(maxInclusive->type(), maxInclusive);
360  }
361 
362  {
363  XsdFacet::Hash &facets = hash[BuiltinTypes::xsLong];
364  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
365  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
366  facets.insert(integerPattern->type(), integerPattern);
367 
368  const XsdFacet::Ptr maxInclusive(new XsdFacet());
369  maxInclusive->setType(XsdFacet::MaximumInclusive);
370  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("9223372036854775807")));
371  facets.insert(maxInclusive->type(), maxInclusive);
372 
373  const XsdFacet::Ptr minInclusive(new XsdFacet());
374  minInclusive->setType(XsdFacet::MinimumInclusive);
375  minInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("-9223372036854775808")));
376  facets.insert(minInclusive->type(), minInclusive);
377  }
378 
379  {
380  XsdFacet::Hash &facets = hash[BuiltinTypes::xsInt];
381  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
382  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
383  facets.insert(integerPattern->type(), integerPattern);
384 
385  const XsdFacet::Ptr maxInclusive(new XsdFacet());
386  maxInclusive->setType(XsdFacet::MaximumInclusive);
387  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("2147483647")));
388  facets.insert(maxInclusive->type(), maxInclusive);
389 
390  const XsdFacet::Ptr minInclusive(new XsdFacet());
391  minInclusive->setType(XsdFacet::MinimumInclusive);
392  minInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("-2147483648")));
393  facets.insert(minInclusive->type(), minInclusive);
394  }
395 
396  {
397  XsdFacet::Hash &facets = hash[BuiltinTypes::xsShort];
398  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
399  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
400  facets.insert(integerPattern->type(), integerPattern);
401 
402  const XsdFacet::Ptr maxInclusive(new XsdFacet());
403  maxInclusive->setType(XsdFacet::MaximumInclusive);
404  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("32767")));
405  facets.insert(maxInclusive->type(), maxInclusive);
406 
407  const XsdFacet::Ptr minInclusive(new XsdFacet());
408  minInclusive->setType(XsdFacet::MinimumInclusive);
409  minInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("-32768")));
410  facets.insert(minInclusive->type(), minInclusive);
411  }
412 
413  {
414  XsdFacet::Hash &facets = hash[BuiltinTypes::xsByte];
415  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
416  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
417  facets.insert(integerPattern->type(), integerPattern);
418 
419  const XsdFacet::Ptr maxInclusive(new XsdFacet());
420  maxInclusive->setType(XsdFacet::MaximumInclusive);
421  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("127")));
422  facets.insert(maxInclusive->type(), maxInclusive);
423 
424  const XsdFacet::Ptr minInclusive(new XsdFacet());
425  minInclusive->setType(XsdFacet::MinimumInclusive);
426  minInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("-128")));
427  facets.insert(minInclusive->type(), minInclusive);
428  }
429 
430  const XsdFacet::Ptr unsignedMinInclusive(new XsdFacet());
431  unsignedMinInclusive->setType(XsdFacet::MinimumInclusive);
432  unsignedMinInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("0")));
433 
434  {
436  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
437  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
438  facets.insert(integerPattern->type(), integerPattern);
439  facets.insert(unsignedMinInclusive->type(), unsignedMinInclusive);
440  }
441 
442  {
444  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
445  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
446  facets.insert(integerPattern->type(), integerPattern);
447  facets.insert(unsignedMinInclusive->type(), unsignedMinInclusive);
448 
449  const XsdFacet::Ptr maxInclusive(new XsdFacet());
450  maxInclusive->setType(XsdFacet::MaximumInclusive);
451  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("18446744073709551615")));
452  facets.insert(maxInclusive->type(), maxInclusive);
453  }
454 
455  {
457  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
458  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
459  facets.insert(integerPattern->type(), integerPattern);
460  facets.insert(unsignedMinInclusive->type(), unsignedMinInclusive);
461 
462  const XsdFacet::Ptr maxInclusive(new XsdFacet());
463  maxInclusive->setType(XsdFacet::MaximumInclusive);
464  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("4294967295")));
465  facets.insert(maxInclusive->type(), maxInclusive);
466  }
467 
468  {
470  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
471  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
472  facets.insert(integerPattern->type(), integerPattern);
473  facets.insert(unsignedMinInclusive->type(), unsignedMinInclusive);
474 
475  const XsdFacet::Ptr maxInclusive(new XsdFacet());
476  maxInclusive->setType(XsdFacet::MaximumInclusive);
477  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("65535")));
478  facets.insert(maxInclusive->type(), maxInclusive);
479  }
480 
481  {
483  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
484  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
485  facets.insert(integerPattern->type(), integerPattern);
486  facets.insert(unsignedMinInclusive->type(), unsignedMinInclusive);
487 
488  const XsdFacet::Ptr maxInclusive(new XsdFacet());
489  maxInclusive->setType(XsdFacet::MaximumInclusive);
490  maxInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("255")));
491  facets.insert(maxInclusive->type(), maxInclusive);
492  }
493 
494  {
496  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
497  facets.insert(fixedZeroFractionDigits->type(), fixedZeroFractionDigits);
498 
499  const XsdFacet::Ptr minInclusive(new XsdFacet());
500  minInclusive->setType(XsdFacet::MinimumInclusive);
501  minInclusive->setValue(DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("1")));
502  facets.insert(minInclusive->type(), minInclusive);
503  }
504 
505  {
507  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
508 
509  const XsdFacet::Ptr pattern(new XsdFacet());
510  pattern->setType(XsdFacet::Pattern);
511  pattern->setMultiValue(AtomicValue::List() << DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("[^DT]*")));
512  facets.insert(pattern->type(), pattern);
513  }
514 
515  {
517  facets.insert(fixedCollapseWhiteSpace->type(), fixedCollapseWhiteSpace);
518 
519  const XsdFacet::Ptr pattern(new XsdFacet());
520  pattern->setType(XsdFacet::Pattern);
521  pattern->setMultiValue(AtomicValue::List() << DerivedString<TypeString>::fromLexical(m_namePool, QString::fromLatin1("[^YM]*(T.*)?")));
522  facets.insert(pattern->type(), pattern);
523  }
524 
525  return hash;
526 }
static uint hash(const uchar *p, int n)
Definition: qhash.cpp:68
Represents a XSD facet object.
Definition: qxsdfacet_p.h:93
static const AtomicType::Ptr xsBase64Binary
static const AtomicType::Ptr xsID
static const AtomicType::Ptr xsDayTimeDuration
static const AtomicType::Ptr xsInt
Match a minimum inclusive (Minimum Inclusive Definition)
Definition: qxsdfacet_p.h:111
static const AtomicType::Ptr xsShort
static const AtomicType::Ptr xsNegativeInteger
static const AtomicType::Ptr xsByte
static const AtomicType::Ptr xsDuration
static const AtomicType::Ptr xsGYearMonth
The QExplicitlySharedDataPointer class represents a pointer to an explicitly shared object...
Definition: qshareddata.h:136
static const AtomicType::Ptr xsNormalizedString
static const AtomicType::Ptr xsGMonthDay
static QString toString(NodeName token)
The QHash class is a template class that provides a hash-table-based dictionary.
Definition: qdatastream.h:66
static const AtomicType::Ptr xsYearMonthDuration
static const AtomicType::Ptr xsName
static const AtomicType::Ptr xsUnsignedByte
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
static const AtomicType::Ptr xsIDREF
static const AtomicType::Ptr xsString
static const AtomicType::Ptr xsNMTOKEN
static const AtomicType::Ptr xsGDay
static const AtomicType::Ptr xsDateTime
static const AtomicType::Ptr xsUnsignedInt
static const AtomicType::Ptr xsDouble
static const AtomicType::Ptr xsENTITY
static const AtomicType::Ptr xsGYear
Match a whitespace rule (White Space Definition)
Definition: qxsdfacet_p.h:108
Match a maximum inclusive (Maximum Inclusive Definition)
Definition: qxsdfacet_p.h:109
static const AtomicType::Ptr xsNonNegativeInteger
Match some double digits (Fraction Digits Definition)
Definition: qxsdfacet_p.h:114
Represents instances of derived xs:string types, such as xs:normalizedString.
static const AtomicType::Ptr xsQName
static const AtomicType::Ptr xsNonPositiveInteger
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
Match a regular expression (Pattern Definition)
Definition: qxsdfacet_p.h:107
static const AtomicType::Ptr xsFloat
static const AtomicType::Ptr xsInteger
static const AtomicType::Ptr xsTime
static const AtomicType::Ptr xsUnsignedShort
static const AtomicType::Ptr xsDecimal
static const AtomicType::Ptr xsBoolean
static const AtomicType::Ptr xsNCName
static const AtomicType::Ptr xsPositiveInteger
Represents instances of derived xs:integer types, such as xs:byte.
static const AtomicType::Ptr xsDate
static const AtomicType::Ptr xsLanguage
static const AtomicType::Ptr xsLong
static const AtomicType::Ptr xsNOTATION
static const AtomicType::Ptr xsGMonth
static const AtomicType::Ptr xsHexBinary
static const AtomicType::Ptr xsUnsignedLong
static const AtomicType::Ptr xsAnyURI
static const AtomicType::Ptr xsToken

◆ setUriResolver()

void XsdSchemaContext::setUriResolver ( const QAbstractUriResolver resolver)

Sets the uri resolver that is used for resolving URIs in the schema parser.

Definition at line 100 of file qxsdschemacontext.cpp.

101 {
103 }
virtual const QAbstractUriResolver * uriResolver() const
const QAbstractUriResolver * m_uriResolver

◆ uriResolver()

const QAbstractUriResolver * XsdSchemaContext::uriResolver ( ) const
virtual

Returns the uri resolver that is used for resolving URIs in the schema parser.

Implements QPatternist::ReportContext.

Definition at line 105 of file qxsdschemacontext.cpp.

Referenced by setUriResolver().

106 {
107  return m_uriResolver;
108 }
const QAbstractUriResolver * m_uriResolver

Properties

◆ m_baseURI

QUrl QPatternist::XsdSchemaContext::m_baseURI
private

Definition at line 177 of file qxsdschemacontext_p.h.

Referenced by baseURI(), and setBaseURI().

◆ m_builtinTypesFacetList

QHash<SchemaType::Ptr, XsdFacet::Hash> QPatternist::XsdSchemaContext::m_builtinTypesFacetList
mutable

Definition at line 170 of file qxsdschemacontext_p.h.

Referenced by facetsForType().

◆ m_messageHandler

QAbstractMessageHandler* QPatternist::XsdSchemaContext::m_messageHandler
private

Definition at line 179 of file qxsdschemacontext_p.h.

Referenced by messageHandler(), and setMessageHandler().

◆ m_namePool

NamePool::Ptr QPatternist::XsdSchemaContext::m_namePool
private

Definition at line 175 of file qxsdschemacontext_p.h.

Referenced by namePool(), schemaTypeFactory(), and setupBuiltinTypesFacetList().

◆ m_networkAccessManager

QNetworkAccessManager* QPatternist::XsdSchemaContext::m_networkAccessManager
private

Definition at line 176 of file qxsdschemacontext_p.h.

Referenced by networkAccessManager(), and setNetworkAccessManager().

◆ m_schemaTypeFactory

SchemaTypeFactory::Ptr QPatternist::XsdSchemaContext::m_schemaTypeFactory
mutable

The following variables should not be accessed directly.

Definition at line 169 of file qxsdschemacontext_p.h.

Referenced by QPatternist::XsdValidatingInstanceReader::loadSchema(), and schemaTypeFactory().

◆ m_uriResolver

const QAbstractUriResolver* QPatternist::XsdSchemaContext::m_uriResolver
private

Definition at line 178 of file qxsdschemacontext_p.h.

Referenced by setUriResolver(), and uriResolver().


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