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

Represents a XSD facet object. More...

#include <qxsdfacet_p.h>

Inheritance diagram for QPatternist::XsdFacet:
QPatternist::NamedSchemaComponent QPatternist::XsdAnnotated QPatternist::SchemaComponent QSharedData

Public Types

typedef QHash< XsdFacet::Type, XsdFacet::PtrHash
 
typedef QHashIterator< XsdFacet::Type, XsdFacet::PtrHashIterator
 
typedef QExplicitlySharedDataPointer< XsdFacetPtr
 
enum  Type {
  None = 0, Length = 1 << 0, MinimumLength = 1 << 1, MaximumLength = 1 << 2,
  Pattern = 1 << 3, WhiteSpace = 1 << 4, MaximumInclusive = 1 << 5, MaximumExclusive = 1 << 6,
  MinimumInclusive = 1 << 7, MinimumExclusive = 1 << 8, TotalDigits = 1 << 9, FractionDigits = 1 << 10,
  Enumeration = 1 << 11, Assertion = 1 << 12
}
 
- Public Types inherited from QPatternist::NamedSchemaComponent
enum  BlockingConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, SubstitutionConstraint = 4 }
 
typedef QExplicitlySharedDataPointer< NamedSchemaComponentPtr
 

Public Functions

XsdAssertion::List assertions () const
 
bool fixed () const
 
AtomicValue::List multiValue () const
 
void setAssertions (const XsdAssertion::List &assertions)
 
void setFixed (bool fixed)
 
void setMultiValue (const AtomicValue::List &value)
 
void setType (Type type)
 
void setValue (const AtomicValue::Ptr &value)
 
Type type () const
 
AtomicValue::Ptr value () const
 
 XsdFacet ()
 
- Public Functions inherited from QPatternist::NamedSchemaComponent
virtual QString displayName (const NamePool::Ptr &namePool) const
 
virtual QXmlName name (const NamePool::Ptr &namePool) const
 
 NamedSchemaComponent ()
 
void setName (const QXmlName &name)
 
virtual ~NamedSchemaComponent ()
 
- 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...
 
- Public Functions inherited from QPatternist::XsdAnnotated
void addAnnotation (const XsdAnnotation::Ptr &annotation)
 
void addAnnotations (const XsdAnnotation::List &annotations)
 
XsdAnnotation::List annotations () const
 

Static Public Functions

static QString typeName (Type type)
 

Properties

XsdAssertion::List m_assertions
 
bool m_fixed
 
AtomicValue::List m_multiValue
 
Type m_type
 
AtomicValue::Ptr m_value
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents a XSD facet object.

This class represents one of the following XML schema 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 93 of file qxsdfacet_p.h.

Typedefs

◆ Hash

Definition at line 118 of file qxsdfacet_p.h.

◆ HashIterator

Definition at line 119 of file qxsdfacet_p.h.

◆ Ptr

Definition at line 96 of file qxsdfacet_p.h.

Enumerations

◆ Type

Describes the type of the facet.

Enumerator
None 

An invalid facet.

Length 

Match the exact length (Length Definition)

MinimumLength 

Match the minimum length (Minimum Length Definition)

MaximumLength 

Match the maximum length (Maximum Length Definition)

Pattern 

Match a regular expression (Pattern Definition)

WhiteSpace 

Match a whitespace rule (White Space Definition)

MaximumInclusive 

Match a maximum inclusive (Maximum Inclusive Definition)

MaximumExclusive 

Match a maximum exclusive (Maximum Exclusive Definition)

MinimumInclusive 

Match a minimum inclusive (Minimum Inclusive Definition)

MinimumExclusive 

Match a minimum exclusive (Minimum Exclusive Definition)

TotalDigits 

Match some integer digits (Total Digits Definition)

FractionDigits 

Match some double digits (Fraction Digits Definition)

Enumeration 

Match an enumeration (Enumeration Definition)

Assertion 

Match an assertion (Assertion Definition)

Definition at line 101 of file qxsdfacet_p.h.

102  {
103  None = 0,
104  Length = 1 << 0,
105  MinimumLength = 1 << 1,
106  MaximumLength = 1 << 2,
107  Pattern = 1 << 3,
108  WhiteSpace = 1 << 4,
109  MaximumInclusive = 1 << 5,
110  MaximumExclusive = 1 << 6,
111  MinimumInclusive = 1 << 7,
112  MinimumExclusive = 1 << 8,
113  TotalDigits = 1 << 9,
114  FractionDigits = 1 << 10,
115  Enumeration = 1 << 11,
116  Assertion = 1 << 12,
117  };
Match an assertion (Assertion Definition)
Definition: qxsdfacet_p.h:116
Match a minimum inclusive (Minimum Inclusive Definition)
Definition: qxsdfacet_p.h:111
An invalid facet.
Definition: qxsdfacet_p.h:103
Match a maximum exclusive (Maximum Exclusive Definition)
Definition: qxsdfacet_p.h:110
Match an enumeration (Enumeration Definition)
Definition: qxsdfacet_p.h:115
Match the minimum length (Minimum Length Definition)
Definition: qxsdfacet_p.h:105
Match a whitespace rule (White Space Definition)
Definition: qxsdfacet_p.h:108
Match a maximum inclusive (Maximum Inclusive Definition)
Definition: qxsdfacet_p.h:109
Match some double digits (Fraction Digits Definition)
Definition: qxsdfacet_p.h:114
Match a minimum exclusive (Minimum Exclusive Definition)
Definition: qxsdfacet_p.h:112
Match some integer digits (Total Digits Definition)
Definition: qxsdfacet_p.h:113
Match the exact length (Length Definition)
Definition: qxsdfacet_p.h:104
Match a regular expression (Pattern Definition)
Definition: qxsdfacet_p.h:107
Match the maximum length (Maximum Length Definition)
Definition: qxsdfacet_p.h:106

Constructors and Destructors

◆ XsdFacet()

XsdFacet::XsdFacet ( )

Creates a new facet object of type None.

Definition at line 48 of file qxsdfacet.cpp.

49  : m_type(None)
50 {
51 }
An invalid facet.
Definition: qxsdfacet_p.h:103

Functions

◆ assertions()

XsdAssertion::List XsdFacet::assertions ( ) const

Returns the assertions of the facet or an empty pointer if facet type is not of type Assertion.

Definition at line 88 of file qxsdfacet.cpp.

Referenced by setAssertions().

89 {
90  return m_assertions;
91 }
XsdAssertion::List m_assertions
Definition: qxsdfacet_p.h:204

◆ fixed()

bool XsdFacet::fixed ( ) const

Returns whether the facet is fixed.

Definition at line 98 of file qxsdfacet.cpp.

Referenced by setFixed().

99 {
100  return m_fixed;
101 }

◆ multiValue()

AtomicValue::List XsdFacet::multiValue ( ) const

Returns the value of the facet or an empty pointer if facet type is not of type Pattern or Enumeration.

Definition at line 78 of file qxsdfacet.cpp.

79 {
80  return m_multiValue;
81 }
AtomicValue::List m_multiValue
Definition: qxsdfacet_p.h:203

◆ setAssertions()

void XsdFacet::setAssertions ( const XsdAssertion::List assertions)

Sets the assertions of the facet.

Note
This method should be used if the type of the facet is Assertion.

Definition at line 83 of file qxsdfacet.cpp.

84 {
86 }
XsdAssertion::List m_assertions
Definition: qxsdfacet_p.h:204
XsdAssertion::List assertions() const
Definition: qxsdfacet.cpp:88

◆ setFixed()

void XsdFacet::setFixed ( bool  fixed)

Sets whether the facet is fixed.

All facets except pattern, enumeration and assertion can be fixed.

Definition at line 93 of file qxsdfacet.cpp.

94 {
95  m_fixed = fixed;
96 }
bool fixed() const
Definition: qxsdfacet.cpp:98

◆ setMultiValue()

void XsdFacet::setMultiValue ( const AtomicValue::List value)

Sets the value of the facet.

Note
This method should be used for if the type of the facet is Pattern or Enumeration.

Definition at line 73 of file qxsdfacet.cpp.

74 {
76 }
AtomicValue::List m_multiValue
Definition: qxsdfacet_p.h:203
AtomicValue::Ptr value() const
Definition: qxsdfacet.cpp:68

◆ setType()

void XsdFacet::setType ( Type  type)

Sets the type of the facet.

See also
Type

Definition at line 53 of file qxsdfacet.cpp.

54 {
55  m_type = type;
56 }
Type type() const
Definition: qxsdfacet.cpp:58

◆ setValue()

void XsdFacet::setValue ( const AtomicValue::Ptr value)

Sets the value of the facet.

Depending on the type of the facet the value can be a string, interger, double etc.

Note
This method should be used for all types of facets except Pattern, Enumeration and Assertion.

Definition at line 63 of file qxsdfacet.cpp.

64 {
65  m_value = value;
66 }
AtomicValue::Ptr m_value
Definition: qxsdfacet_p.h:202
AtomicValue::Ptr value() const
Definition: qxsdfacet.cpp:68

◆ type()

XsdFacet::Type XsdFacet::type ( ) const

Returns the type of the facet.

Definition at line 58 of file qxsdfacet.cpp.

Referenced by setType().

59 {
60  return m_type;
61 }

◆ typeName()

QString XsdFacet::typeName ( Type  type)
static

Returns the textual description of the facet type.

Definition at line 103 of file qxsdfacet.cpp.

Referenced by QPatternist::XsdSchemaChecker::checkConstrainingFacets(), and QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints().

104 {
105  switch (type) {
106  case Length: return QLatin1String("length"); break;
107  case MinimumLength: return QLatin1String("minLength"); break;
108  case MaximumLength: return QLatin1String("maxLength"); break;
109  case Pattern: return QLatin1String("pattern"); break;
110  case WhiteSpace: return QLatin1String("whiteSpace"); break;
111  case MaximumInclusive: return QLatin1String("maxInclusive"); break;
112  case MaximumExclusive: return QLatin1String("maxExclusive"); break;
113  case MinimumInclusive: return QLatin1String("minInclusive"); break;
114  case MinimumExclusive: return QLatin1String("minExclusive"); break;
115  case TotalDigits: return QLatin1String("totalDigits"); break;
116  case FractionDigits: return QLatin1String("fractionDigits"); break;
117  case Enumeration: return QLatin1String("enumeration"); break;
118  case Assertion: return QLatin1String("assertion"); break;
119  case None: // fall through
120  default: return QLatin1String("none"); break;
121  }
122 }
Match an assertion (Assertion Definition)
Definition: qxsdfacet_p.h:116
Match a minimum inclusive (Minimum Inclusive Definition)
Definition: qxsdfacet_p.h:111
An invalid facet.
Definition: qxsdfacet_p.h:103
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Match a maximum exclusive (Maximum Exclusive Definition)
Definition: qxsdfacet_p.h:110
Match an enumeration (Enumeration Definition)
Definition: qxsdfacet_p.h:115
Match the minimum length (Minimum Length Definition)
Definition: qxsdfacet_p.h:105
Match a whitespace rule (White Space Definition)
Definition: qxsdfacet_p.h:108
Match a maximum inclusive (Maximum Inclusive Definition)
Definition: qxsdfacet_p.h:109
Match some double digits (Fraction Digits Definition)
Definition: qxsdfacet_p.h:114
Match a minimum exclusive (Minimum Exclusive Definition)
Definition: qxsdfacet_p.h:112
Match some integer digits (Total Digits Definition)
Definition: qxsdfacet_p.h:113
Match the exact length (Length Definition)
Definition: qxsdfacet_p.h:104
Match a regular expression (Pattern Definition)
Definition: qxsdfacet_p.h:107
Type type() const
Definition: qxsdfacet.cpp:58
Match the maximum length (Maximum Length Definition)
Definition: qxsdfacet_p.h:106

◆ value()

AtomicValue::Ptr XsdFacet::value ( ) const

Returns the value of the facet or an empty pointer if facet type is Pattern, Enumeration or Assertion.

Definition at line 68 of file qxsdfacet.cpp.

Referenced by setMultiValue(), and setValue().

69 {
70  return m_value;
71 }
AtomicValue::Ptr m_value
Definition: qxsdfacet_p.h:202

Properties

◆ m_assertions

XsdAssertion::List QPatternist::XsdFacet::m_assertions
private

Definition at line 204 of file qxsdfacet_p.h.

Referenced by assertions(), and setAssertions().

◆ m_fixed

bool QPatternist::XsdFacet::m_fixed
private

Definition at line 205 of file qxsdfacet_p.h.

Referenced by fixed(), and setFixed().

◆ m_multiValue

AtomicValue::List QPatternist::XsdFacet::m_multiValue
private

Definition at line 203 of file qxsdfacet_p.h.

Referenced by multiValue(), and setMultiValue().

◆ m_type

Type QPatternist::XsdFacet::m_type
private

Definition at line 201 of file qxsdfacet_p.h.

Referenced by setType(), and type().

◆ m_value

AtomicValue::Ptr QPatternist::XsdFacet::m_value
private

Definition at line 202 of file qxsdfacet_p.h.

Referenced by setValue(), and value().


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