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

A helper class for element and group reference resolving. More...

#include <qxsdreference_p.h>

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

Public Types

typedef QExplicitlySharedDataPointer< XsdReferencePtr
 
enum  Type { Element, ModelGroup }
 
- 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

virtual bool isReference () const
 
QXmlName referenceName () const
 
void setReferenceName (const QXmlName &ame)
 
void setSourceLocation (const QSourceLocation &location)
 
void setType (Type type)
 
QSourceLocation sourceLocation () const
 
Type type () const
 
- Public Functions inherited from QPatternist::XsdTerm
virtual bool isElement () const
 
virtual bool isModelGroup () 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

QXmlName m_referenceName
 
QSourceLocation m_sourceLocation
 
Type m_type
 

Additional Inherited Members

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

Detailed Description

A helper class for element and group reference resolving.

For easy resolving of element and group references, we have this class that can be used as a place holder for the real element or group object it is referring to. So whenever the parser detects an element or group reference, it creates a XsdReference and returns it instead of the XsdElement or XsdModelGroup. During a later phase, the resolver will look for all XsdReferences in the schema and will replace them with their referring XsdElement or XsdModelGroup objects.

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

Definition at line 80 of file qxsdreference_p.h.

Typedefs

◆ Ptr

Definition at line 83 of file qxsdreference_p.h.

Enumerations

◆ Type

Describes the type of the reference.

Enumerator
Element 

The reference points to an element.

ModelGroup 

The reference points to a model group.

Definition at line 88 of file qxsdreference_p.h.

89  {
90  Element,
91  ModelGroup
92  };
The reference points to a model group.
The reference points to an element.

Functions

◆ isReference()

bool XsdReference::isReference ( ) const
virtual

Returns always true, used to avoid dynamic casts.

Reimplemented from QPatternist::XsdTerm.

Definition at line 48 of file qxsdreference.cpp.

49 {
50  return true;
51 }

◆ referenceName()

QXmlName XsdReference::referenceName ( ) const

Returns the name of the referenced object.

Definition at line 68 of file qxsdreference.cpp.

Referenced by setReferenceName().

69 {
70  return m_referenceName;
71 }

◆ setReferenceName()

void XsdReference::setReferenceName ( const QXmlName ame)

Sets the name of the referenced object.

The name can either be a top-level element declaration or a top-level group declaration.

Definition at line 63 of file qxsdreference.cpp.

64 {
66 }
QXmlName referenceName() const

◆ setSourceLocation()

void XsdReference::setSourceLocation ( const QSourceLocation location)

Sets the source location where the reference is located.

Definition at line 73 of file qxsdreference.cpp.

74 {
76 }
QSourceLocation m_sourceLocation
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63

◆ setType()

void XsdReference::setType ( Type  type)

Sets the type of the reference.

See also
Type

Definition at line 53 of file qxsdreference.cpp.

◆ sourceLocation()

QSourceLocation XsdReference::sourceLocation ( ) const

Returns the source location where the reference is located.

Definition at line 78 of file qxsdreference.cpp.

79 {
80  return m_sourceLocation;
81 }
QSourceLocation m_sourceLocation

◆ type()

XsdReference::Type XsdReference::type ( ) const

Returns the type of the reference.

Definition at line 58 of file qxsdreference.cpp.

Referenced by setType().

59 {
60  return m_type;
61 }

Properties

◆ m_referenceName

QXmlName QPatternist::XsdReference::m_referenceName
private

Definition at line 136 of file qxsdreference_p.h.

Referenced by referenceName(), and setReferenceName().

◆ m_sourceLocation

QSourceLocation QPatternist::XsdReference::m_sourceLocation
private

Definition at line 137 of file qxsdreference_p.h.

Referenced by setSourceLocation(), and sourceLocation().

◆ m_type

Type QPatternist::XsdReference::m_type
private

Definition at line 135 of file qxsdreference_p.h.

Referenced by setType(), and type().


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