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.
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 Element.cpp.
te::xsd::Element::Element | ( | const Element & | rhs | ) |
te::xsd::Element::~Element | ( | ) |
Destructor.
Definition at line 72 of file Element.cpp.
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 Element.cpp.
|
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 Element.cpp.
std::string * te::xsd::Element::getDefaultValue | ( | ) | const |
It returns the default value for the element.
Definition at line 90 of file Element.cpp.
std::string * te::xsd::Element::getFixedValue | ( | ) | const |
It returns the fixed value for the element.
Definition at line 95 of file Element.cpp.
|
inherited |
It returns a pointer (may be NULL) to the object id.
Definition at line 35 of file Identifiable.cpp.
|
inherited |
It returns the maxOccurs values.
Definition at line 40 of file Occurs.cpp.
|
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 Element.cpp.
te::xsd::QName * te::xsd::Element::getRef | ( | ) | const |
It returns the reference to a name of another element.
Definition at line 153 of file Element.cpp.
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 Element.cpp.
bool te::xsd::Element::isAbstract | ( | ) |
If the element is "abstract" or not.
Definition at line 105 of file Element.cpp.
bool te::xsd::Element::isNillable | ( | ) |
If the element is "nillable" or not.
Definition at line 100 of file Element.cpp.
te::xsd::Element & te::xsd::Element::operator= | ( | const Element & | rhs | ) |
Assignment operator.
rhs | Right-hand-side object. |
Definition at line 80 of file 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.
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 Element.cpp.
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 Element.cpp.
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 Element.cpp.
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 Element.cpp.
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 Element.cpp.
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 Element.cpp.
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 Element.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().
|
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.
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.
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 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 Element.cpp.
void te::xsd::Element::setSubstitutionGroup | ( | QName * | g | ) |
It sets the substitution group.
g | The substitution group. |
Definition at line 177 of file Element.cpp.
void te::xsd::Element::setType | ( | QName * | t | ) |
It sets the element type.
t | The element type. |
Definition at line 115 of file Element.cpp.
|
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.
|
private |
|
private |
|
private |
|
private |
|
private |
|
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)
|
private |
|
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::operator=().
|
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(), and te::xsd::Occurs::operator=().
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticinherited |
Identifer for "unbounded" max values.
Definition at line 108 of file Occurs.h.
Referenced by te::xsd::serialize::ReadOccurs().