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

Represents a XSD attribute use object. More...

#include <qxsdattributeuse_p.h>

Inheritance diagram for QPatternist::XsdAttributeUse:
QPatternist::XsdAttributeTerm QPatternist::NamedSchemaComponent QPatternist::XsdAnnotated QPatternist::SchemaComponent QSharedData QPatternist::XsdAttributeReference

Classes

class  ValueConstraint
 

Public Types

typedef QList< XsdAttributeUse::PtrList
 
typedef QExplicitlySharedDataPointer< XsdAttributeUsePtr
 
enum  UseType { OptionalUse, RequiredUse, ProhibitedUse }
 
- Public Types inherited from QPatternist::XsdAttributeTerm
typedef QExplicitlySharedDataPointer< XsdAttributeTermPtr
 
- Public Types inherited from QPatternist::NamedSchemaComponent
enum  BlockingConstraint { RestrictionConstraint = 1, ExtensionConstraint = 2, SubstitutionConstraint = 4 }
 
typedef QExplicitlySharedDataPointer< NamedSchemaComponentPtr
 

Public Functions

XsdAttribute::Ptr attribute () const
 
virtual bool isAttributeUse () const
 
bool isRequired () const
 
void setAttribute (const XsdAttribute::Ptr &attribute)
 
void setUseType (UseType type)
 
void setValueConstraint (const ValueConstraint::Ptr &constraint)
 
UseType useType () const
 
ValueConstraint::Ptr valueConstraint () const
 
 XsdAttributeUse ()
 
- Public Functions inherited from QPatternist::XsdAttributeTerm
virtual bool isReference () 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

XsdAttribute::Ptr m_attribute
 
UseType m_useType
 
ValueConstraint::Ptr m_valueConstraint
 

Additional Inherited Members

- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Represents a XSD attribute use object.

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

It contains information from a local attribute declaration (as child of complexType or attributeGroup object).

All other occurrences of the attribute object are represented by the XsdAttribute class.

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 81 of file qxsdattributeuse_p.h.

Typedefs

◆ List

Definition at line 85 of file qxsdattributeuse_p.h.

◆ Ptr

Definition at line 84 of file qxsdattributeuse_p.h.

Enumerations

◆ UseType

Describes the use type of the attribute use.

Enumerator
OptionalUse 

The attribute can be there but doesn't need to.

RequiredUse 

The attribute must be there.

ProhibitedUse 

The attribute is not allowed to be there.

Definition at line 150 of file qxsdattributeuse_p.h.

151  {
152  OptionalUse,
153  RequiredUse,
155  };
The attribute is not allowed to be there.
The attribute can be there but doesn&#39;t need to.

Constructors and Destructors

◆ XsdAttributeUse()

XsdAttributeUse::XsdAttributeUse ( )

Creates a new attribute use object.

Definition at line 91 of file qxsdattributeuse.cpp.

93 {
94 }
The attribute can be there but doesn&#39;t need to.

Functions

◆ attribute()

XsdAttribute::Ptr XsdAttributeUse::attribute ( ) const

Returns the attribute the attribute use is referring to.

Definition at line 121 of file qxsdattributeuse.cpp.

Referenced by setAttribute().

122 {
123  return m_attribute;
124 }

◆ isAttributeUse()

bool XsdAttributeUse::isAttributeUse ( ) const
virtual

Always returns true, used to avoid dynamic casts.

Reimplemented from QPatternist::XsdAttributeTerm.

Reimplemented in QPatternist::XsdAttributeReference.

Definition at line 96 of file qxsdattributeuse.cpp.

97 {
98  return true;
99 }

◆ isRequired()

bool XsdAttributeUse::isRequired ( ) const

Returns whether the attribute use is required.

See also
Required Definition

Definition at line 111 of file qxsdattributeuse.cpp.

112 {
113  return (m_useType == RequiredUse);
114 }

◆ setAttribute()

void XsdAttributeUse::setAttribute ( const XsdAttribute::Ptr attribute)

Sets the attribute the attribute use is referring to. That is either a local definition as child of a complexType or attributeGroup object, or a reference defined by the 'ref' attribute.

See also
Attribute Declaration

Definition at line 116 of file qxsdattributeuse.cpp.

117 {
119 }
XsdAttribute::Ptr attribute() const

◆ setUseType()

void XsdAttributeUse::setUseType ( UseType  type)

Sets the use type of the attribute use.

See also
UseType

Definition at line 101 of file qxsdattributeuse.cpp.

102 {
103  m_useType = type;
104 }
int type
Definition: qmetatype.cpp:239

◆ setValueConstraint()

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

Sets the value constraint of the attribute use.

See also
http://www.w3.org/TR/xmlschema11-1/#vc_au

Definition at line 126 of file qxsdattributeuse.cpp.

127 {
128  m_valueConstraint = constraint;
129 }
ValueConstraint::Ptr m_valueConstraint

◆ useType()

XsdAttributeUse::UseType XsdAttributeUse::useType ( ) const

Returns the use type of the attribute use.

Definition at line 106 of file qxsdattributeuse.cpp.

107 {
108  return m_useType;
109 }

◆ valueConstraint()

XsdAttributeUse::ValueConstraint::Ptr XsdAttributeUse::valueConstraint ( ) const

Returns the value constraint of the attribute use.

Definition at line 131 of file qxsdattributeuse.cpp.

132 {
133  return m_valueConstraint;
134 }
ValueConstraint::Ptr m_valueConstraint

Properties

◆ m_attribute

XsdAttribute::Ptr QPatternist::XsdAttributeUse::m_attribute
private

Definition at line 215 of file qxsdattributeuse_p.h.

Referenced by attribute(), and setAttribute().

◆ m_useType

UseType QPatternist::XsdAttributeUse::m_useType
private

Definition at line 214 of file qxsdattributeuse_p.h.

Referenced by isRequired(), setUseType(), and useType().

◆ m_valueConstraint

ValueConstraint::Ptr QPatternist::XsdAttributeUse::m_valueConstraint
private

Definition at line 216 of file qxsdattributeuse_p.h.

Referenced by setValueConstraint(), and valueConstraint().


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