This class models the element of a XML Schema. More...
#include <Element.h>
Public Member Functions | |
| void | addIdentityConstraint (IdentityConstraint *ic) |
| It adds an IdentityConstraint to the element. More... | |
| Element (unsigned int minOccurs=1, unsigned int maxOccurs=1, Annotation *ann=0, std::string *id=0) | |
| Constructor. More... | |
| Element (const Element &rhs) | |
| Copy constructor. More... | |
| Annotation * | getAnnotation () const |
| It returns the associated annotation. More... | |
| int | getBlock () |
| It returns the block value for the element. It prevents an element with a specified type of derivation from being used in place of this element. More... | |
| std::string * | getDefaultValue () const |
| It returns the default value for the element. More... | |
| std::string * | getFixedValue () const |
| It returns the fixed value for the element. More... | |
| std::string * | getId () const |
| It returns a pointer (may be NULL) to the object id. More... | |
| const unsigned int | getMaxOccurs () const |
| It returns the maxOccurs values. More... | |
| const unsigned int | getMinOccurs () const |
| It returns the minOccurs values. More... | |
| std::string * | getName () const |
| It returns the element name or NULL if it doesn't have one. More... | |
| QName * | getRef () const |
| It returns the reference to a name of another element. More... | |
| QName * | getType () const |
| It returns the name of a built-in data type, or the name of a simpleType or complexType element. More... | |
| bool | isAbstract () |
| If the element is "abstract" or not. More... | |
| bool | isNillable () |
| If the element is "nillable" or not. More... | |
| Element & | operator= (const Element &rhs) |
| Assignment operator. More... | |
| void | setAnnotation (Annotation *ann) |
| It sets the associated annotation. More... | |
| void | setAsAbstract (bool v) |
| It specifies whether the element can be used in an instance document. More... | |
| void | setAsNillable (bool v) |
| It specifies whether an explicit null value can be assigned to the element. More... | |
| void | setBlock (int v) |
| It prevents an element with a specified type of derivation from being used in place of this element. More... | |
| void | setContentType (Type *t) |
| It sets the content type of the element. More... | |
| void | setDefaultValue (std::string *v) |
| It sets the default value for the element. More... | |
| void | setFinal (int v) |
| It sets the default value of the final attribute on the element element. More... | |
| void | setFixedValue (std::string *v) |
| It sets a fixed value for the element. More... | |
| void | setId (std::string *id) |
| it sets the id. More... | |
| void | setMaxOccurs (unsigned int maxOccurs) |
| It sets the maxOccurs value. More... | |
| void | setMinOccurs (unsigned int minOccurs) |
| It sets the minOccurs value. More... | |
| void | setName (std::string *name) |
| It sets the element name. More... | |
| void | setRef (QName *ref) |
| It sets a reference to a name of another element. More... | |
| void | setSubstitutionGroup (QName *g) |
| It sets the substitution group. More... | |
| void | setType (QName *t) |
| It sets the element type. More... | |
| ~Element () | |
| Destructor. More... | |
Static Public Attributes | |
| static const unsigned int | unbounded = std::numeric_limits<unsigned int>::max() |
| Identifer for "unbounded" max values. More... | |
Protected Attributes | |
| unsigned int | m_maxOccurs |
| It specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. (Optional) More... | |
| unsigned int | m_minOccurs |
| It specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1. (Optional) More... | |
Private Attributes | |
| bool | m_abstract |
| It specifies whether the element can be used in an instance document. True indicates that the element cannot appear in the instance document. Instead, another element whose substitutionGroup attribute contains the qualified name (QName) of this element must appear in this element's place. Default is false. More... | |
| int | m_block |
| It prevents an element with a specified type of derivation from being used in place of this element. (Optional) More... | |
| Type * | m_contentType |
| A content of this element. A simpleType or complexType element can be present as a child only if both the ref and type attributes are not present. More... | |
| std::string * | m_default |
| It specifies a default value for the element (can only be used if the element's content is a simple type or text only). More... | |
| int | m_final |
| It sets the default value of the final attribute on the element element. More... | |
| std::string * | m_fixed |
| It ensures that the elements are set to particular value. More... | |
| Form | m_form |
| Here, "unqualified" indicates that this attribute is not required to be qualified with the namespace prefix. "qualified" indicates that this attribute must be qualified with the namespace prefix. The default value is the value of the elementFormDefault attribute of the schema element. (Optional) More... | |
| boost::ptr_vector< IdentityConstraint > | m_identityConstraintVec |
| The list of elements related to identity constraint - (key | keyref | unique)*. (Optional) More... | |
| std::string * | m_name |
| It specifies a name for the element. (Optional) More... | |
| bool | m_nillable |
| It specifies whether an explicit null value can be assigned to the element. True enables an instance of the element to have the null attribute set to true. The null attribute is defined as part of the XML Schema namespace for instances. Default is false. More... | |
| QName * | m_ref |
| It refers to the name of another element. The ref attribute can include a namespace prefix. More... | |
| QName * | m_substitutionGroup |
| It specifies the element that can be substituted with this element. More... | |
| QName * | m_type |
| It specifies either the name of a built-in data type, or the name of a simpleType or complexType element. (Optional) More... | |
This class models the element of a XML Schema.
Definition at line 56 of file xsd/Element.h.
| te::xsd::Element::Element | ( | unsigned int | minOccurs = 1, |
| unsigned int | maxOccurs = 1, |
||
| Annotation * | ann = 0, |
||
| std::string * | id = 0 |
||
| ) |
Constructor.
| id | It specifies a unique ID for the element. It can be a NULL value. |
Definition at line 34 of file xsd/Element.cpp.
| te::xsd::Element::Element | ( | const Element & | rhs | ) |
Copy constructor.
| rhs | Right-hand-side object. |
Definition at line 53 of file xsd/Element.cpp.
| te::xsd::Element::~Element | ( | ) |
Destructor.
Definition at line 72 of file xsd/Element.cpp.
References m_contentType, m_default, m_fixed, and m_type.
| void te::xsd::Element::addIdentityConstraint | ( | IdentityConstraint * | ic | ) |
It adds an IdentityConstraint to the element.
| ic | The IdentityConstraint that will be added. |
Definition at line 194 of file xsd/Element.cpp.
References m_identityConstraintVec.
|
inherited |
It returns the associated annotation.
Definition at line 30 of file Annotated.cpp.
References te::xsd::Annotated::m_annotation.
| int te::xsd::Element::getBlock | ( | ) |
It returns the block value for the element. It prevents an element with a specified type of derivation from being used in place of this element.
Definition at line 110 of file xsd/Element.cpp.
References m_block.
| std::string * te::xsd::Element::getDefaultValue | ( | ) | const |
It returns the default value for the element.
Definition at line 90 of file xsd/Element.cpp.
References m_default.
| std::string * te::xsd::Element::getFixedValue | ( | ) | const |
It returns the fixed value for the element.
Definition at line 95 of file xsd/Element.cpp.
References m_fixed.
|
inherited |
It returns a pointer (may be NULL) to the object id.
Definition at line 35 of file Identifiable.cpp.
References te::xsd::Identifiable::m_id.
|
inherited |
It returns the maxOccurs values.
Definition at line 40 of file Occurs.cpp.
References te::xsd::Occurs::m_maxOccurs.
|
inherited |
It returns the minOccurs values.
Definition at line 35 of file Occurs.cpp.
References te::xsd::Occurs::m_minOccurs.
| std::string * te::xsd::Element::getName | ( | ) | const |
It returns the element name or NULL if it doesn't have one.
Definition at line 148 of file xsd/Element.cpp.
References m_name.
| te::xsd::QName * te::xsd::Element::getRef | ( | ) | const |
It returns the reference to a name of another element.
Definition at line 153 of file xsd/Element.cpp.
References m_ref.
| te::xsd::QName * te::xsd::Element::getType | ( | ) | const |
It returns the name of a built-in data type, or the name of a simpleType or complexType element.
Definition at line 85 of file xsd/Element.cpp.
References m_type.
| bool te::xsd::Element::isAbstract | ( | ) |
If the element is "abstract" or not.
Definition at line 105 of file xsd/Element.cpp.
References m_abstract.
| bool te::xsd::Element::isNillable | ( | ) |
If the element is "nillable" or not.
Definition at line 100 of file xsd/Element.cpp.
References m_nillable.
| te::xsd::Element & te::xsd::Element::operator= | ( | const Element & | rhs | ) |
Assignment operator.
| rhs | Right-hand-side object. |
Definition at line 80 of file xsd/Element.cpp.
|
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.
References te::xsd::Annotated::m_annotation.
Referenced by te::xsd::serialize::ReadAnnotated().
| void te::xsd::Element::setAsAbstract | ( | bool | v | ) |
It specifies whether the element can be used in an instance document.
| v | True indicates that the element cannot appear in the instance document. Instead, another element whose substitutionGroup attribute contains the qualified name (QName) of this element must appear in this element's place. |
Definition at line 138 of file xsd/Element.cpp.
References m_abstract.
| void te::xsd::Element::setAsNillable | ( | bool | v | ) |
It specifies whether an explicit null value can be assigned to the element.
| v | True enables an instance of the element to have the null attribute set to true. |
Definition at line 133 of file xsd/Element.cpp.
References m_nillable.
| void te::xsd::Element::setBlock | ( | int | v | ) |
It prevents an element with a specified type of derivation from being used in place of this element.
| v | It can be: #all|list of (extension|restriction). |
Definition at line 143 of file xsd/Element.cpp.
References m_block.
| void te::xsd::Element::setContentType | ( | Type * | t | ) |
It sets the content type of the element.
| t | The content type of the element. |
Definition at line 188 of file xsd/Element.cpp.
References m_contentType.
| void te::xsd::Element::setDefaultValue | ( | std::string * | v | ) |
It sets the default value for the element.
| v | The element default value. |
Definition at line 121 of file xsd/Element.cpp.
References m_default.
| void te::xsd::Element::setFinal | ( | int | v | ) |
It sets the default value of the final attribute on the element element.
| v | It can be: #all|list of (extension|restriction). |
Definition at line 183 of file xsd/Element.cpp.
References m_final.
| void te::xsd::Element::setFixedValue | ( | std::string * | v | ) |
It sets a fixed value for the element.
| v | A fixed value for the element. |
Definition at line 127 of file xsd/Element.cpp.
References m_fixed.
|
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().
|
inherited |
It sets the maxOccurs value.
| maxOccurs | The maxOccurs value. The value can be any number >= 0. |
Definition at line 50 of file Occurs.cpp.
References te::xsd::Occurs::m_maxOccurs.
Referenced by te::xsd::serialize::ReadOccurs().
|
inherited |
It sets the minOccurs value.
| minOccurs | The minOccurs value. The value can be any number >= 0. |
Definition at line 45 of file Occurs.cpp.
References te::xsd::Occurs::m_minOccurs.
Referenced by te::xsd::serialize::ReadOccurs().
| void te::xsd::Element::setName | ( | std::string * | name | ) |
It sets the element name.
| name | The element name. |
Definition at line 158 of file xsd/Element.cpp.
| void te::xsd::Element::setRef | ( | QName * | ref | ) |
It sets a reference to a name of another element.
| ref | A reference to a name of another element. |
Definition at line 167 of file xsd/Element.cpp.
| void te::xsd::Element::setSubstitutionGroup | ( | QName * | g | ) |
It sets the substitution group.
| g | The substitution group. |
Definition at line 177 of file xsd/Element.cpp.
References m_substitutionGroup.
| void te::xsd::Element::setType | ( | QName * | t | ) |
It sets the element type.
| t | The element type. |
Definition at line 115 of file xsd/Element.cpp.
References m_type.
|
private |
It specifies whether the element can be used in an instance document. True indicates that the element cannot appear in the instance document. Instead, another element whose substitutionGroup attribute contains the qualified name (QName) of this element must appear in this element's place. Default is false.
Definition at line 262 of file xsd/Element.h.
Referenced by isAbstract(), and setAsAbstract().
|
private |
It prevents an element with a specified type of derivation from being used in place of this element. (Optional)
Definition at line 263 of file xsd/Element.h.
Referenced by getBlock(), and setBlock().
|
private |
A content of this element. A simpleType or complexType element can be present as a child only if both the ref and type attributes are not present.
Definition at line 265 of file xsd/Element.h.
Referenced by setContentType(), and ~Element().
|
private |
It specifies a default value for the element (can only be used if the element's content is a simple type or text only).
Definition at line 258 of file xsd/Element.h.
Referenced by getDefaultValue(), setDefaultValue(), and ~Element().
|
private |
It sets the default value of the final attribute on the element element.
Definition at line 264 of file xsd/Element.h.
Referenced by setFinal().
|
private |
It ensures that the elements are set to particular value.
Definition at line 259 of file xsd/Element.h.
Referenced by getFixedValue(), setFixedValue(), and ~Element().
|
private |
Here, "unqualified" indicates that this attribute is not required to be qualified with the namespace prefix. "qualified" indicates that this attribute must be qualified with the namespace prefix. The default value is the value of the elementFormDefault attribute of the schema element. (Optional)
Definition at line 260 of file xsd/Element.h.
|
private |
The list of elements related to identity constraint - (key | keyref | unique)*. (Optional)
Definition at line 266 of file xsd/Element.h.
Referenced by addIdentityConstraint().
|
protectedinherited |
It specifies the maximum number of times the any element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1. (Optional)
Definition at line 113 of file Occurs.h.
Referenced by te::xsd::Occurs::getMaxOccurs(), te::xsd::Occurs::operator=(), and te::xsd::Occurs::setMaxOccurs().
|
protectedinherited |
It specifies the minimum number of times the any element can occur in the parent element. The value can be any number >= 0. Default value is 1. (Optional)
Definition at line 112 of file Occurs.h.
Referenced by te::xsd::Occurs::getMinOccurs(), te::xsd::Occurs::operator=(), and te::xsd::Occurs::setMinOccurs().
|
private |
It specifies a name for the element. (Optional)
Definition at line 254 of file xsd/Element.h.
|
private |
It specifies whether an explicit null value can be assigned to the element. True enables an instance of the element to have the null attribute set to true. The null attribute is defined as part of the XML Schema namespace for instances. Default is false.
Definition at line 261 of file xsd/Element.h.
Referenced by isNillable(), and setAsNillable().
|
private |
It refers to the name of another element. The ref attribute can include a namespace prefix.
Definition at line 255 of file xsd/Element.h.
|
private |
It specifies the element that can be substituted with this element.
Definition at line 257 of file xsd/Element.h.
Referenced by setSubstitutionGroup().
|
private |
It specifies either the name of a built-in data type, or the name of a simpleType or complexType element. (Optional)
Definition at line 256 of file xsd/Element.h.
Referenced by getType(), setType(), and ~Element().
|
staticinherited |
Identifer for "unbounded" max values.
Definition at line 108 of file Occurs.h.
Referenced by te::xsd::serialize::ReadOccurs().