te::xsd::Attribute Class Reference

It models a XML Schema attribute. More...

#include <Attribute.h>

Inheritance diagram for te::xsd::Attribute:
te::xsd::AbstractAttribute te::xsd::Identifiable te::xsd::Annotated

Public Member Functions

 Attribute (Annotation *ann=0, std::string *id=0)
 Constructor. More...
 
 Attribute (const Attribute &rhs)
 Copy constructor. More...
 
AbstractAttributeclone () const
 Add a property with non-schema namespace to the attribute. More...
 
AnnotationgetAnnotation () const
 It returns the associated annotation. More...
 
std::string * getDefault () const
 It returns the default value for the attribute. More...
 
std::string * getFixed () const
 It returns the fixed value for the attribute. More...
 
Form getForm () const
 It returns the form property value of attribute. More...
 
std::string * getId () const
 It returns a pointer (may be NULL) to the object id. More...
 
SimpleTypegetInnerType () const
 It returns the simpleType element of the attribute. More...
 
std::string * getName () const
 It returns the name of the attribute. More...
 
QNamegetRef () const
 It returns the reference to a named attribute element. More...
 
QNamegetType () const
 It returns a built-in data type or simple type for the attribute element. More...
 
AttributeUse getUse () const
 It returns a AttributeUse object that specifies how how the attribute is used. More...
 
Attributeoperator= (const Attribute &rhs)
 Assignment operator. More...
 
void setAnnotation (Annotation *ann)
 It sets the associated annotation. More...
 
void setDefault (std::string *def)
 It returns a map with other properties of the attribute element. More...
 
void setFixed (std::string *fix)
 It sets a fixed value for the attribute. More...
 
void setForm (Form f)
 It sets the form property of the attribute. More...
 
void setId (std::string *id)
 it sets the id. More...
 
void setInnerType (SimpleType *iType)
 It sets a inner simpleType element for the attribute. More...
 
void setName (std::string *name)
 It sets a name for the attribute. More...
 
void setRef (QName *ref)
 It sets a reference to a named attribute. More...
 
void setType (QName *type)
 It sets a built-in data type or simple type for the attribute. More...
 
void setUse (AttributeUse use)
 It sets how the attribute is used. More...
 
 ~Attribute ()
 Destructor. More...
 

Private Attributes

std::string * m_default
 It specifies a default value for the attribute (Optional). More...
 
std::string * m_fixed
 It specifies a fixed value for the attribute (Optional). More...
 
Form m_form
 It specifies if the attribute must be qualified or not. Default = unqualified. (Optional) More...
 
SimpleTypem_innerType
 It specifies the attribute type as a simple type. It will be NULL if m_ref is present or if m_type is present. (Optional) More...
 
std::string * m_name
 It specifies a name for the attribute. It will be NULL if m_ref is present. (Optional) More...
 
QNamem_ref
 It specifies a reference to a named attribute. NULL if m_name is present. (Optional) More...
 
QNamem_type
 It specifies a built-in data type or simple type for the attribute. It is NULL if m_ref is present or m_innerType. (Optional) More...
 
AttributeUse m_use
 It specifies how the attribute is used. (Optional) More...
 

Detailed Description

It models a XML Schema attribute.

It models a XML Schema attribute group.

Some notes:

  • Attributes can not contain other elements or other attributes.
  • The default and fixed attributes can not both be present.
  • Name and ref attributes cannot both be present. If ref is present the named type, form, and SimpleType cannot be present.
  • If a named type is used, ref and SimpleType cannot be present.
Note
Parent elements: attributeGroup, schema, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent).

An attribute group can be used to group a set of attribute declarations to be incorporated as a group into a complex type definition.

Note
Parent elements: attributeGroup, complexType, schema, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent)

Definition at line 61 of file Attribute.h.

Constructor & Destructor Documentation

te::xsd::Attribute::Attribute ( Annotation ann = 0,
std::string *  id = 0 
)

Constructor.

Parameters
annAn annotation.
idIt specifies a unique ID for the element.
Note
The Attribute object will take the ownership of the annotation and id.
te::xsd::Attribute::Attribute ( const Attribute rhs)

Copy constructor.

Parameters
rhsRight-hand-side object.
te::xsd::Attribute::~Attribute ( )

Destructor.

Member Function Documentation

AbstractAttribute* te::xsd::Attribute::clone ( ) const
virtual

Add a property with non-schema namespace to the attribute.

Parameters
keyThe name of the property.
valueThe value of the property.

Implements te::xsd::AbstractAttribute.

Annotation* te::xsd::Annotated::getAnnotation ( ) const
inherited

It returns the associated annotation.

Returns
The associated annotation.
std::string* te::xsd::Attribute::getDefault ( ) const

It returns the default value for the attribute.

Returns
The default value.
std::string* te::xsd::Attribute::getFixed ( ) const

It returns the fixed value for the attribute.

Returns
The fixed value.
Form te::xsd::Attribute::getForm ( ) const

It returns the form property value of attribute.

Returns
Form property value of attribute: Qualified or Unqualified.
std::string* te::xsd::Identifiable::getId ( ) const
inherited

It returns a pointer (may be NULL) to the object id.

SimpleType* te::xsd::Attribute::getInnerType ( ) const

It returns the simpleType element of the attribute.

Returns
A simpleType element.
std::string* te::xsd::Attribute::getName ( ) const

It returns the name of the attribute.

Returns
The name of the object.
QName* te::xsd::Attribute::getRef ( ) const

It returns the reference to a named attribute element.

Returns
The reference to a named attribute element.
QName* te::xsd::Attribute::getType ( ) const

It returns a built-in data type or simple type for the attribute element.

Returns
A built-in data type or simple type for the attribute element.
AttributeUse te::xsd::Attribute::getUse ( ) const

It returns a AttributeUse object that specifies how how the attribute is used.

Returns
An AttributeUse object that specifies how the attribute is used.
Attribute& te::xsd::Attribute::operator= ( const Attribute rhs)

Assignment operator.

Parameters
rhsRight-hand-side object.
Returns
A reference to this object.
void te::xsd::Annotated::setAnnotation ( Annotation ann)
inherited

It sets the associated annotation.

Parameters
annThe annotation to be associated to the object. The annotated class will take the ownership of the given pointer.
void te::xsd::Attribute::setDefault ( std::string *  def)

It returns a map with other properties of the attribute element.

Returns
Other properties of the attribute element as a key-value map.

It sets a default value for the attribute.

Parameters
defA default value.
Note
Setting the default property will turn to NULL the fixed property.
The Attribute object will take the ownership of the given pointer.
void te::xsd::Attribute::setFixed ( std::string *  fix)

It sets a fixed value for the attribute.

Parameters
fixA fixed value.
Note
Setting the fixed property will turn to NULL the default property.
The Attribute object will take the ownership of the given pointer.
void te::xsd::Attribute::setForm ( Form  f)

It sets the form property of the attribute.

Parameters
fThe value for form property of the attribute: Qualified or Unqualified.
void te::xsd::Identifiable::setId ( std::string *  id)
inherited

it sets the id.

Parameters
idThe id to be associated to the object. It will take the ownership of the given string.
void te::xsd::Attribute::setInnerType ( SimpleType iType)

It sets a inner simpleType element for the attribute.

Parameters
iTypeA SimpleType object that represents a inner simpleType element for the attribute.
Note
Setting a simpleType element for the attribute will turn to NULL the reference and type properties.
The Attribute object will take the ownership of the given pointer.
void te::xsd::Attribute::setName ( std::string *  name)

It sets a name for the attribute.

Parameters
nameA name for this attribute.
Note
Setting a name will turn to NULL the reference property.
The Attribute object will take the ownership of the given pointer.
void te::xsd::Attribute::setRef ( QName ref)

It sets a reference to a named attribute.

Parameters
refA reference to a named attribute as a QName object.
Note
Setting a reference will turn to NULL the name and type properties and the SimpleType element.
The Attribute object will take the ownership of the given pointer.
void te::xsd::Attribute::setType ( QName type)

It sets a built-in data type or simple type for the attribute.

Parameters
typeA built-in data type or simple type as a QName object.
Note
Setting a reference will turn to NULL the reference property and the inner SimpleType element.
The Attribute object will take the ownership of the given pointer.
void te::xsd::Attribute::setUse ( AttributeUse  use)

It sets how the attribute is used.

Parameters
useA AttributeUse object that specifies how the attribute is used.

Member Data Documentation

std::string* te::xsd::Attribute::m_default
private

It specifies a default value for the attribute (Optional).

Definition at line 243 of file Attribute.h.

std::string* te::xsd::Attribute::m_fixed
private

It specifies a fixed value for the attribute (Optional).

Definition at line 244 of file Attribute.h.

Form te::xsd::Attribute::m_form
private

It specifies if the attribute must be qualified or not. Default = unqualified. (Optional)

Definition at line 245 of file Attribute.h.

SimpleType* te::xsd::Attribute::m_innerType
private

It specifies the attribute type as a simple type. It will be NULL if m_ref is present or if m_type is present. (Optional)

Definition at line 250 of file Attribute.h.

std::string* te::xsd::Attribute::m_name
private

It specifies a name for the attribute. It will be NULL if m_ref is present. (Optional)

Definition at line 246 of file Attribute.h.

QName* te::xsd::Attribute::m_ref
private

It specifies a reference to a named attribute. NULL if m_name is present. (Optional)

Definition at line 247 of file Attribute.h.

QName* te::xsd::Attribute::m_type
private

It specifies a built-in data type or simple type for the attribute. It is NULL if m_ref is present or m_innerType. (Optional)

Definition at line 248 of file Attribute.h.

AttributeUse te::xsd::Attribute::m_use
private

It specifies how the attribute is used. (Optional)

Definition at line 249 of file Attribute.h.


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