It models a XML Schema attribute. More...
#include <Attribute.h>
Public Member Functions | |
Attribute (Annotation *ann=0, std::string *id=0) | |
Constructor. More... | |
Attribute (const Attribute &rhs) | |
Copy constructor. More... | |
AbstractAttribute * | clone () const |
Add a property with non-schema namespace to the attribute. More... | |
Annotation * | getAnnotation () 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... | |
SimpleType * | getInnerType () const |
It returns the simpleType element of the attribute. More... | |
std::string * | getName () const |
It returns the name of the attribute. More... | |
QName * | getRef () const |
It returns the reference to a named attribute element. More... | |
QName * | getType () 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... | |
Attribute & | operator= (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... | |
SimpleType * | m_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... | |
QName * | m_ref |
It specifies a reference to a named attribute. NULL if m_name is present. (Optional) More... | |
QName * | m_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... | |
It models a XML Schema attribute.
It models a XML Schema attribute group.
Some notes:
An attribute group can be used to group a set of attribute declarations to be incorporated as a group into a complex type definition.
Definition at line 61 of file Attribute.h.
te::xsd::Attribute::Attribute | ( | Annotation * | ann = 0 , |
std::string * | id = 0 |
||
) |
Constructor.
ann | An annotation. |
id | It specifies a unique ID for the element. |
Definition at line 31 of file Attribute.cpp.
te::xsd::Attribute::Attribute | ( | const Attribute & | rhs | ) |
Copy constructor.
rhs | Right-hand-side object. |
Definition at line 46 of file Attribute.cpp.
References m_default, m_fixed, m_innerType, m_name, m_ref, and m_type.
te::xsd::Attribute::~Attribute | ( | ) |
Destructor.
Definition at line 66 of file Attribute.cpp.
|
virtual |
Add a property with non-schema namespace to the attribute.
key | The name of the property. |
value | The value of the property. |
Implements te::xsd::AbstractAttribute.
Definition at line 247 of file Attribute.cpp.
References te::sa::Attribute.
|
inherited |
It returns the associated annotation.
Definition at line 30 of file Annotated.cpp.
References te::xsd::Annotated::m_annotation.
std::string * te::xsd::Attribute::getDefault | ( | ) | const |
It returns the default value for the attribute.
Definition at line 118 of file Attribute.cpp.
std::string * te::xsd::Attribute::getFixed | ( | ) | const |
It returns the fixed value for the attribute.
Definition at line 123 of file Attribute.cpp.
te::xsd::Form te::xsd::Attribute::getForm | ( | ) | const |
It returns the form property value of attribute.
Definition at line 128 of file Attribute.cpp.
|
inherited |
It returns a pointer (may be NULL) to the object id.
Definition at line 35 of file Identifiable.cpp.
te::xsd::SimpleType * te::xsd::Attribute::getInnerType | ( | ) | const |
It returns the simpleType element of the attribute.
Definition at line 153 of file Attribute.cpp.
std::string * te::xsd::Attribute::getName | ( | ) | const |
It returns the name of the attribute.
Definition at line 133 of file Attribute.cpp.
te::xsd::QName * te::xsd::Attribute::getRef | ( | ) | const |
It returns the reference to a named attribute element.
Definition at line 138 of file Attribute.cpp.
te::xsd::QName * te::xsd::Attribute::getType | ( | ) | const |
It returns a built-in data type or simple type for the attribute element.
Definition at line 143 of file Attribute.cpp.
te::xsd::AttributeUse te::xsd::Attribute::getUse | ( | ) | const |
It returns a AttributeUse object that specifies how how the attribute is used.
Definition at line 148 of file Attribute.cpp.
te::xsd::Attribute & te::xsd::Attribute::operator= | ( | const Attribute & | rhs | ) |
Assignment operator.
rhs | Right-hand-side object. |
Definition at line 77 of file Attribute.cpp.
References m_default, m_fixed, m_form, m_innerType, m_name, m_ref, m_type, m_use, te::xsd::Identifiable::operator=(), and te::xsd::Annotated::operator=().
|
inherited |
It sets the associated annotation.
ann | The annotation to be associated to the object. The annotated class will take the ownership of the given pointer. |
Definition at line 35 of file Annotated.cpp.
Referenced by te::xsd::serialize::ReadAnnotated().
void te::xsd::Attribute::setDefault | ( | std::string * | def | ) |
It returns a map with other properties of the attribute element.
It sets a default value for the attribute.
def | A default value. |
Definition at line 163 of file Attribute.cpp.
void te::xsd::Attribute::setFixed | ( | std::string * | fix | ) |
It sets a fixed value for the attribute.
fix | A fixed value. |
Definition at line 172 of file Attribute.cpp.
void te::xsd::Attribute::setForm | ( | Form | f | ) |
It sets the form property of the attribute.
f | The value for form property of the attribute: Qualified or Unqualified. |
Definition at line 181 of file Attribute.cpp.
|
inherited |
it sets the id.
id | The id to be associated to the object. It will take the ownership of the given string. |
Definition at line 29 of file Identifiable.cpp.
References te::xsd::Identifiable::m_id.
Referenced by te::xsd::serialize::ReadIdentifiable().
void te::xsd::Attribute::setInnerType | ( | SimpleType * | iType | ) |
It sets a inner simpleType element for the attribute.
iType | A SimpleType object that represents a inner simpleType element for the attribute. |
Definition at line 227 of file Attribute.cpp.
void te::xsd::Attribute::setName | ( | std::string * | name | ) |
It sets a name for the attribute.
name | A name for this attribute. |
Definition at line 186 of file Attribute.cpp.
void te::xsd::Attribute::setRef | ( | QName * | ref | ) |
It sets a reference to a named attribute.
ref | A reference to a named attribute as a QName object. |
Definition at line 195 of file Attribute.cpp.
void te::xsd::Attribute::setType | ( | QName * | type | ) |
It sets a built-in data type or simple type for the attribute.
type | A built-in data type or simple type as a QName object. |
Definition at line 210 of file Attribute.cpp.
void te::xsd::Attribute::setUse | ( | AttributeUse | use | ) |
It sets how the attribute is used.
use | A AttributeUse object that specifies how the attribute is used. |
Definition at line 222 of file Attribute.cpp.
|
private |
It specifies a default value for the attribute (Optional).
Definition at line 243 of file Attribute.h.
Referenced by Attribute(), and operator=().
|
private |
It specifies a fixed value for the attribute (Optional).
Definition at line 244 of file Attribute.h.
Referenced by Attribute(), and operator=().
|
private |
It specifies if the attribute must be qualified or not. Default = unqualified. (Optional)
Definition at line 245 of file Attribute.h.
Referenced by operator=().
|
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.
Referenced by Attribute(), and operator=().
|
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.
Referenced by Attribute(), and operator=().
|
private |
It specifies a reference to a named attribute. NULL if m_name is present. (Optional)
Definition at line 247 of file Attribute.h.
Referenced by Attribute(), and operator=().
|
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.
Referenced by Attribute(), and operator=().
|
private |
It specifies how the attribute is used. (Optional)
Definition at line 249 of file Attribute.h.
Referenced by operator=().