Qt 4.8
Public Types | Public Functions | Protected Functions | Friends | List of all members
QPatternist::AnyType Class Reference

Represents the xs:anyType item type. More...

#include <qanytype_p.h>

Inheritance diagram for QPatternist::AnyType:
QPatternist::SchemaType QPatternist::SchemaComponent QSharedData QPatternist::AnySimpleType QPatternist::Untyped QPatternist::XsdUserSchemaType< AnyType > QPatternist::AtomicType QPatternist::XsdUserSchemaType< AnySimpleType > QPatternist::XsdComplexType QPatternist::BuiltinAtomicType QPatternist::NumericType QPatternist::XsdSimpleType QPatternist::AnyAtomicType QPatternist::AnyURIType QPatternist::Base64BinaryType QPatternist::BooleanType QPatternist::DateTimeType QPatternist::DateType QPatternist::DayTimeDurationType QPatternist::DecimalType QPatternist::DoubleType QPatternist::DurationType QPatternist::FloatType QPatternist::GDayType QPatternist::GMonthDayType QPatternist::GMonthType QPatternist::GYearMonthType QPatternist::GYearType QPatternist::HexBinaryType QPatternist::IntegerType QPatternist::NOTATIONType QPatternist::QNameType QPatternist::SchemaTimeType QPatternist::StringType QPatternist::UntypedAtomicType QPatternist::YearMonthDurationType

Public Types

typedef QExplicitlySharedDataPointer< AnyTypePtr
 
- Public Types inherited from QPatternist::SchemaType
enum  DerivationConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, ListConstraint = 4, UnionConstraint = 8 }
 
enum  DerivationMethod {
  DerivationRestriction = 1, DerivationExtension = 2, DerivationUnion = 4, DerivationList = 8,
  NoDerivation = 16
}
 
typedef QHash< QXmlName, SchemaType::PtrHash
 
typedef QList< SchemaType::PtrList
 
typedef QExplicitlySharedDataPointer< SchemaTypePtr
 
enum  TypeCategory {
  None = 0, SimpleTypeAtomic, SimpleTypeList, SimpleTypeUnion,
  ComplexType
}
 

Public Functions

virtual TypeCategory category () const
 
virtual DerivationConstraints derivationConstraints () const
 
virtual DerivationMethod derivationMethod () const
 
virtual QString displayName (const NamePool::Ptr &np) const
 
virtual bool isAbstract () const
 
virtual bool isComplexType () const
 
virtual QXmlName name (const NamePool::Ptr &np) const
 Returns the name of the type. More...
 
virtual SchemaType::Ptr wxsSuperType () const
 
virtual bool wxsTypeMatches (const SchemaType::Ptr &other) const
 
virtual ~AnyType ()
 
- Public Functions inherited from QPatternist::SchemaType
virtual bool isDefinedBySchema () const
 
virtual bool isSimpleType () const
 
 SchemaType ()
 
virtual ~SchemaType ()
 
- Public Functions inherited from QPatternist::SchemaComponent
 SchemaComponent ()
 
virtual ~SchemaComponent ()
 
- Public Functions inherited from QSharedData
 QSharedData ()
 Constructs a QSharedData object with a reference count of 0. More...
 
 QSharedData (const QSharedData &)
 Constructs a QSharedData object with reference count 0. More...
 

Protected Functions

 AnyType ()
 This constructor is protected, because this class must be sub-classed. More...
 

Friends

class BuiltinTypes
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents the xs:anyType item type.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 71 of file qanytype_p.h.

Typedefs

◆ Ptr

Definition at line 75 of file qanytype_p.h.

Constructors and Destructors

◆ ~AnyType()

AnyType::~AnyType ( )
virtual

Definition at line 50 of file qanytype.cpp.

51 {
52 }

◆ AnyType()

QPatternist::AnyType::AnyType ( )
inlineprotected

This constructor is protected, because this class must be sub-classed.

Definition at line 132 of file qanytype_p.h.

133  {
134  }

Functions

◆ category()

SchemaType::TypeCategory AnyType::category ( ) const
virtual

xs:anyType is the "ur-type" and special. Therefore, this function returns SchemaType::None.

Returns
SchemaType::None

Implements QPatternist::SchemaType.

Reimplemented in QPatternist::XsdComplexType, QPatternist::XsdSimpleType, QPatternist::AtomicType, QPatternist::AnySimpleType, and QPatternist::Untyped.

Definition at line 83 of file qanytype.cpp.

84 {
85  return None;
86 }

◆ derivationConstraints()

SchemaType::DerivationConstraints AnyType::derivationConstraints ( ) const
virtual
Returns
an empty set of derivation constraint flags.

Implements QPatternist::SchemaType.

Reimplemented in QPatternist::XsdUserSchemaType< AnyType >, and QPatternist::XsdUserSchemaType< AnySimpleType >.

Definition at line 98 of file qanytype.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints().

99 {
100  return SchemaType::DerivationConstraints();
101 }

◆ derivationMethod()

SchemaType::DerivationMethod AnyType::derivationMethod ( ) const
virtual

◆ displayName()

QString AnyType::displayName ( const NamePool::Ptr np) const
virtual

◆ isAbstract()

bool AnyType::isAbstract ( ) const
virtual
Returns
always false

Implements QPatternist::SchemaType.

Reimplemented in QPatternist::NOTATIONType, QPatternist::XsdComplexType, QPatternist::AnyAtomicType, QPatternist::NumericType, and QPatternist::BuiltinAtomicType.

Definition at line 62 of file qanytype.cpp.

63 {
64  return false;
65 }

◆ isComplexType()

bool AnyType::isComplexType ( ) const
virtual

Always returns true.

Reimplemented from QPatternist::SchemaType.

Reimplemented in QPatternist::AnySimpleType.

Definition at line 88 of file qanytype.cpp.

89 {
90  return true;
91 }

◆ name()

QXmlName AnyType::name ( const NamePool::Ptr np) const
virtual

Returns the name of the type.

The reason to why we take the name pool argument, is that the basic types, xs:anySimpleType and so on, are stored globally in BuiltinTypes and ComonSequenceTypes, and therefore cannot be tied to a certain name pool. Type instances that knows they always will be used with a certain name pool, can therefore ignore np and return a QXmlName instance stored as a member.

If the type code was refactored to not be store globally and therefore by design would be tied to a name pool, this argument could be removed.

Implements QPatternist::SchemaType.

Reimplemented in QPatternist::NOTATIONType, QPatternist::DerivedStringType< derivedType >, QPatternist::StringType, QPatternist::QNameType, QPatternist::AnyURIType, QPatternist::HexBinaryType, QPatternist::Base64BinaryType, QPatternist::BooleanType, QPatternist::GMonthType, QPatternist::GDayType, QPatternist::GMonthDayType, QPatternist::GYearType, QPatternist::GYearMonthType, QPatternist::DerivedIntegerType< derivedType >, QPatternist::IntegerType, QPatternist::DecimalType, QPatternist::FloatType, QPatternist::DoubleType, QPatternist::DayTimeDurationType, QPatternist::YearMonthDurationType, QPatternist::DurationType, QPatternist::SchemaTimeType, QPatternist::DateType, QPatternist::DateTimeType, QPatternist::UntypedAtomicType, QPatternist::XsdUserSchemaType< AnyType >, QPatternist::XsdUserSchemaType< AnySimpleType >, QPatternist::Untyped, QPatternist::AnySimpleType, and QPatternist::AnyAtomicType.

Definition at line 67 of file qanytype.cpp.

68 {
69  return np->allocateQName(StandardNamespaces::xs, QLatin1String("anyType"));
70 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QXmlName allocateQName(const QString &uri, const QString &localName, const QString &prefix=QString())
Definition: qnamepool.cpp:251

◆ wxsSuperType()

SchemaType::Ptr AnyType::wxsSuperType ( ) const
virtual
Returns
null, since xs:anyType has no base type, it is the ur-type.
always null

Implements QPatternist::SchemaType.

Reimplemented in QPatternist::XsdComplexType, QPatternist::XsdSimpleType, QPatternist::NumericType, QPatternist::AnyAtomicType, QPatternist::AnySimpleType, QPatternist::BuiltinAtomicType, and QPatternist::Untyped.

Definition at line 78 of file qanytype.cpp.

79 {
80  return SchemaType::Ptr();
81 }
QExplicitlySharedDataPointer< SchemaType > Ptr
Definition: qschematype_p.h:82

◆ wxsTypeMatches()

bool AnyType::wxsTypeMatches ( const SchemaType::Ptr other) const
virtual
Returns
true only if other is xsAnyType.

Implements QPatternist::SchemaType.

Definition at line 54 of file qanytype.cpp.

Referenced by QPatternist::AtomicType::itemMatches().

55 {
56  if(other)
57  return this == other.data() ? true : wxsTypeMatches(other->wxsSuperType());
58  else
59  return false;
60 }
T * data() const
Returns a pointer to the shared data object.
Definition: qshareddata.h:145
virtual bool wxsTypeMatches(const SchemaType::Ptr &other) const
Definition: qanytype.cpp:54
virtual SchemaType::Ptr wxsSuperType() const =0

Friends and Related Functions

◆ BuiltinTypes

friend class BuiltinTypes
friend

Definition at line 76 of file qanytype_p.h.


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