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

Represents a XSD element object. More...

#include <qxsdelement_p.h>

Inheritance diagram for QPatternist::XsdElement:
QPatternist::XsdTerm QPatternist::NamedSchemaComponent QPatternist::XsdAnnotated QPatternist::SchemaComponent QSharedData

Classes

class  Scope
 
class  TypeTable
 
class  ValueConstraint
 

Public Types

enum  ConstraintType { NoneConstraint, DefaultConstraint, FixedConstraint }
 
typedef QList< XsdElement::PtrList
 
typedef QExplicitlySharedDataPointer< XsdElementPtr
 
typedef QList< XsdElement * > WeakList
 
- Public Types inherited from QPatternist::XsdTerm
typedef QExplicitlySharedDataPointer< XsdTermPtr
 
- Public Types inherited from QPatternist::NamedSchemaComponent
enum  BlockingConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, SubstitutionConstraint = 4 }
 
typedef QExplicitlySharedDataPointer< NamedSchemaComponentPtr
 

Public Functions

void addIdentityConstraint (const XsdIdentityConstraint::Ptr &constraint)
 
void addSubstitutionGroup (const XsdElement::Ptr &elements)
 
BlockingConstraints disallowedSubstitutions () const
 
XsdIdentityConstraint::List identityConstraints () const
 
bool isAbstract () const
 
virtual bool isElement () const
 
bool isNillable () const
 
Scope::Ptr scope () const
 
void setDisallowedSubstitutions (const BlockingConstraints &substitutions)
 
void setIdentityConstraints (const XsdIdentityConstraint::List &constraints)
 
void setIsAbstract (bool abstract)
 
void setIsNillable (bool nillable)
 
void setScope (const Scope::Ptr &scope)
 
void setSubstitutionGroupAffiliations (const XsdElement::List &affiliations)
 
void setSubstitutionGroupExclusions (const SchemaType::DerivationConstraints &exclusions)
 
void setType (const SchemaType::Ptr &type)
 
void setTypeTable (const TypeTable::Ptr &table)
 
void setValueConstraint (const ValueConstraint::Ptr &constraint)
 
XsdElement::List substitutionGroupAffiliations () const
 
SchemaType::DerivationConstraints substitutionGroupExclusions () const
 
XsdElement::WeakList substitutionGroups () const
 
SchemaType::Ptr type () const
 
TypeTable::Ptr typeTable () const
 
ValueConstraint::Ptr valueConstraint () const
 
 XsdElement ()
 
- Public Functions inherited from QPatternist::XsdTerm
virtual bool isModelGroup () const
 
virtual bool isReference () const
 
virtual bool isWildcard () const
 
- 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
 

Properties

BlockingConstraints m_disallowedSubstitutions
 
XsdIdentityConstraint::List m_identityConstraints
 
bool m_isAbstract
 
bool m_isNillable
 
Scope::Ptr m_scope
 
XsdElement::List m_substitutionGroupAffiliations
 
SchemaType::DerivationConstraints m_substitutionGroupExclusions
 
QSet< XsdElement * > m_substitutionGroups
 
SchemaTypem_type
 
TypeTable::Ptr m_typeTable
 
ValueConstraint::Ptr m_valueConstraint
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 
- Protected Functions inherited from QPatternist::XsdTerm
 XsdTerm ()
 

Detailed Description

Represents a XSD element object.

This class represents the element object of a XML schema as described here.

It contains information from either a top-level element declaration (as child of a schema object) or a local element declaration (as descendant of an complexType object).

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 83 of file qxsdelement_p.h.

Typedefs

◆ List

Definition at line 87 of file qxsdelement_p.h.

◆ Ptr

Definition at line 86 of file qxsdelement_p.h.

◆ WeakList

Definition at line 88 of file qxsdelement_p.h.

Enumerations

◆ ConstraintType

Describes the constraint type of the element.

Enumerator
NoneConstraint 

The value of the element has no constraints.

DefaultConstraint 

The element has a default value set.

FixedConstraint 

The element has a fixed value set.

Definition at line 93 of file qxsdelement_p.h.

94  {
98  };
The value of the element has no constraints.
Definition: qxsdelement_p.h:95
The element has a default value set.
Definition: qxsdelement_p.h:96
The element has a fixed value set.
Definition: qxsdelement_p.h:97

Constructors and Destructors

◆ XsdElement()

XsdElement::XsdElement ( )

Creates a new element object.

Definition at line 119 of file qxsdelement.cpp.

120  : m_isAbstract(false)
121 {
122 }

Functions

◆ addIdentityConstraint()

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

Adds a new identity constraint to the element.

Definition at line 214 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().

215 {
216  m_identityConstraints.append(constraint);
217 }
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
XsdIdentityConstraint::List m_identityConstraints

◆ addSubstitutionGroup()

void XsdElement::addSubstitutionGroup ( const XsdElement::Ptr elements)

Adds a substitution group to the element.

Definition at line 234 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaResolver::resolveSubstitutionGroups().

235 {
236  m_substitutionGroups.insert(element.data());
237 }
QSet< XsdElement * > m_substitutionGroups

◆ disallowedSubstitutions()

XsdElement::BlockingConstraints XsdElement::disallowedSubstitutions ( ) const

◆ identityConstraints()

XsdIdentityConstraint::List XsdElement::identityConstraints ( ) const

Returns a list of all identity constraints of the element.

Definition at line 219 of file qxsdelement.cpp.

Referenced by QPatternist::XsdValidatingInstanceReader::validateIdentityConstraint().

220 {
221  return m_identityConstraints;
222 }
XsdIdentityConstraint::List m_identityConstraints

◆ isAbstract()

bool XsdElement::isAbstract ( ) const

Returns whether the element is abstract.

Definition at line 174 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaDebugger::dumpElement(), and QPatternist::XsdValidatingInstanceReader::validateElement().

175 {
176  return m_isAbstract;
177 }

◆ isElement()

bool XsdElement::isElement ( ) const
virtual

Always returns true, used to avoid dynamic casts.

Reimplemented from QPatternist::XsdTerm.

Definition at line 124 of file qxsdelement.cpp.

125 {
126  return true;
127 }

◆ isNillable()

bool XsdElement::isNillable ( ) const

◆ scope()

XsdElement::Scope::Ptr XsdElement::scope ( ) const

◆ setDisallowedSubstitutions()

void XsdElement::setDisallowedSubstitutions ( const BlockingConstraints &  substitutions)

Sets the disallowed substitutions of the element.

Only ExtensionConstraint, RestrictionConstraint and SubstitutionConstraint are allowed.

See also
Disallowed Substitutions Definition

Definition at line 189 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().

190 {
191  m_disallowedSubstitutions = substitutions;
192 }
BlockingConstraints m_disallowedSubstitutions

◆ setIdentityConstraints()

void XsdElement::setIdentityConstraints ( const XsdIdentityConstraint::List constraints)

Sets the identity constraints of the element.

See also
Identity Constraint Definition

Definition at line 209 of file qxsdelement.cpp.

210 {
211  m_identityConstraints = constraints;
212 }
XsdIdentityConstraint::List m_identityConstraints

◆ setIsAbstract()

void XsdElement::setIsAbstract ( bool  abstract)

Sets whether the element is abstract.

See also
Abstract Definition

Definition at line 169 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdValidatingInstanceReader::validate().

170 {
171  m_isAbstract = abstract;
172 }

◆ setIsNillable()

void XsdElement::setIsNillable ( bool  nillable)

◆ setScope()

void XsdElement::setScope ( const Scope::Ptr scope)

Sets the scope of the element.

See also
Scope Definition

Definition at line 139 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().

140 {
141  m_scope = scope;
142 }
Scope::Ptr scope() const

◆ setSubstitutionGroupAffiliations()

void XsdElement::setSubstitutionGroupAffiliations ( const XsdElement::List affiliations)

Sets the substitution group affiliations of the element.

See also
Substitution Group Affiliations

Definition at line 224 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaResolver::resolveSubstitutionGroupAffiliations().

225 {
226  m_substitutionGroupAffiliations = affiliations;
227 }
XsdElement::List m_substitutionGroupAffiliations

◆ setSubstitutionGroupExclusions()

void XsdElement::setSubstitutionGroupExclusions ( const SchemaType::DerivationConstraints &  exclusions)

Sets the substitution group exclusions of the element.

Only SchemaType::ExtensionConstraint and SchemaType::RestrictionConstraint are allowed.

See also
Substitution Group Exclusions Definition

Definition at line 199 of file qxsdelement.cpp.

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

200 {
201  m_substitutionGroupExclusions = exclusions;
202 }
SchemaType::DerivationConstraints m_substitutionGroupExclusions

◆ setType()

void XsdElement::setType ( const SchemaType::Ptr type)

◆ setTypeTable()

void XsdElement::setTypeTable ( const TypeTable::Ptr table)

Sets the type table of the element.

See also
Type Table Definition

Definition at line 159 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().

160 {
161  m_typeTable = table;
162 }
TypeTable::Ptr m_typeTable

◆ setValueConstraint()

void XsdElement::setValueConstraint ( const ValueConstraint::Ptr constraint)

Sets the value constraint of the element.

See also
Value Constraint Definition

Definition at line 149 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().

150 {
151  m_valueConstraint = constraint;
152 }
ValueConstraint::Ptr m_valueConstraint

◆ substitutionGroupAffiliations()

XsdElement::List XsdElement::substitutionGroupAffiliations ( ) const

◆ substitutionGroupExclusions()

SchemaType::DerivationConstraints XsdElement::substitutionGroupExclusions ( ) const

Returns the substitution group exclusions of the element.

Definition at line 204 of file qxsdelement.cpp.

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

205 {
207 }
SchemaType::DerivationConstraints m_substitutionGroupExclusions

◆ substitutionGroups()

XsdElement::WeakList XsdElement::substitutionGroups ( ) const

Returns the substitution groups of the element.

Definition at line 239 of file qxsdelement.cpp.

Referenced by QPatternist::XsdStateMachineBuilder::buildTerm(), and hasDuplicatedElementsInternal().

240 {
241  return m_substitutionGroups.toList();
242 }
QSet< XsdElement * > m_substitutionGroups

◆ type()

SchemaType::Ptr XsdElement::type ( ) const

◆ typeTable()

XsdElement::TypeTable::Ptr XsdElement::typeTable ( ) const

Returns the type table of the element.

Definition at line 164 of file qxsdelement.cpp.

Referenced by QPatternist::XsdSchemaParser::parseGlobalElement(), and QPatternist::XsdSchemaParser::parseLocalElement().

165 {
166  return m_typeTable;
167 }
TypeTable::Ptr m_typeTable

◆ valueConstraint()

XsdElement::ValueConstraint::Ptr XsdElement::valueConstraint ( ) const

Properties

◆ m_disallowedSubstitutions

BlockingConstraints QPatternist::XsdElement::m_disallowedSubstitutions
private

Definition at line 391 of file qxsdelement_p.h.

Referenced by disallowedSubstitutions(), and setDisallowedSubstitutions().

◆ m_identityConstraints

XsdIdentityConstraint::List QPatternist::XsdElement::m_identityConstraints
private

◆ m_isAbstract

bool QPatternist::XsdElement::m_isAbstract
private

Definition at line 389 of file qxsdelement_p.h.

Referenced by isAbstract(), and setIsAbstract().

◆ m_isNillable

bool QPatternist::XsdElement::m_isNillable
private

Definition at line 390 of file qxsdelement_p.h.

Referenced by isNillable(), and setIsNillable().

◆ m_scope

Scope::Ptr QPatternist::XsdElement::m_scope
private

Definition at line 386 of file qxsdelement_p.h.

Referenced by scope(), and setScope().

◆ m_substitutionGroupAffiliations

XsdElement::List QPatternist::XsdElement::m_substitutionGroupAffiliations
private

◆ m_substitutionGroupExclusions

SchemaType::DerivationConstraints QPatternist::XsdElement::m_substitutionGroupExclusions
private

Definition at line 392 of file qxsdelement_p.h.

Referenced by setSubstitutionGroupExclusions(), and substitutionGroupExclusions().

◆ m_substitutionGroups

QSet<XsdElement *> QPatternist::XsdElement::m_substitutionGroups
private

Definition at line 395 of file qxsdelement_p.h.

Referenced by addSubstitutionGroup(), and substitutionGroups().

◆ m_type

SchemaType* QPatternist::XsdElement::m_type
private

Definition at line 385 of file qxsdelement_p.h.

Referenced by setType(), and type().

◆ m_typeTable

TypeTable::Ptr QPatternist::XsdElement::m_typeTable
private

Definition at line 388 of file qxsdelement_p.h.

Referenced by setTypeTable(), and typeTable().

◆ m_valueConstraint

ValueConstraint::Ptr QPatternist::XsdElement::m_valueConstraint
private

Definition at line 387 of file qxsdelement_p.h.

Referenced by setValueConstraint(), and valueConstraint().


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