All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Schema.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/xsd/Schema.cpp
22 
23  \brief A class that models an XML Schema (XSD).
24 */
25 
26 // TerraLib
27 #include "Schema.h"
28 
29 // STL
30 #include <cassert>
31 
32 te::xsd::Schema::Schema(std::string* id)
33  : Identifiable(id),
34  m_attributeFormDefault(Unqualified),
35  m_elementFormDefault(Unqualified),
36  m_blockDefault(UNKNOWN),
37  m_finalDefault(UNKNOWN)
38 {
39 }
40 
42 {
43 }
44 
45 const boost::ptr_vector<te::xsd::Include>& te::xsd::Schema::getIncludes() const
46 {
47  return m_includeVec;
48 }
49 
50 const boost::ptr_vector<te::xsd::Import>& te::xsd::Schema::getImports() const
51 {
52  return m_importVec;
53 }
54 
55 const boost::ptr_vector<te::xsd::Redefine>& te::xsd::Schema::getRedefines() const
56 {
57  return m_redefineVec;
58 }
59 
60 const boost::ptr_vector<te::xsd::Annotation>& te::xsd::Schema::getAnnotations() const
61 {
62  return m_annotationVec;
63 }
64 
65 const boost::ptr_vector<te::xsd::SimpleType>& te::xsd::Schema::getSimpleTypes() const
66 {
67  return m_simpleTypeVec;
68 }
69 
70 const boost::ptr_vector<te::xsd::ComplexType>& te::xsd::Schema::getComplexTypes() const
71 {
72  return m_complexTypeVec;
73 }
74 
75 const boost::ptr_vector<te::xsd::Group>& te::xsd::Schema::getGroups() const
76 {
77  return m_groupVec;
78 }
79 
80 const boost::ptr_vector<te::xsd::AttributeGroup>& te::xsd::Schema::getAttributeGroups() const
81 {
82  return m_attributeGroupVec;
83 }
84 
85 const boost::ptr_vector<te::xsd::AbstractAttribute>& te::xsd::Schema::getAttributes() const
86 {
87  return m_attributeVec;
88 }
89 
90 const boost::ptr_vector<te::xsd::Element>& te::xsd::Schema::getElements() const
91 {
92  return m_elementVec;
93 }
94 
95 const boost::ptr_vector<te::xsd::Notation>& te::xsd::Schema::getNotations() const
96 {
97  return m_notationVec;
98 }
99 
100 void te::xsd::Schema::addNamespace(const std::string& ns, const std::string& nsprefix)
101 {
102  m_xmlns.insert(boost::bimap<std::string, std::string>::value_type(nsprefix, ns));
103 }
104 
106 {
107  m_includeVec.push_back(i);
108 }
109 
111 {
112  m_importVec.push_back(i);
113 }
114 
116 {
117  m_redefineVec.push_back(r);
118 }
119 
121 {
122  m_annotationVec.push_back(a);
123 }
124 
126 {
127  m_simpleTypeVec.push_back(s);
128 }
129 
131 {
132  m_complexTypeVec.push_back(c);
133 }
134 
136 {
137  m_groupVec.push_back(g);
138 }
139 
141 {
142  m_attributeGroupVec.push_back(ag);
143 }
144 
146 {
147  m_attributeVec.push_back(a);
148 }
149 
151 {
152  m_elementVec.push_back(e);
153 }
154 
156 {
157  m_notationVec.push_back(n);
158 }
void addAnnotation(Annotation *a)
Definition: Schema.cpp:120
const boost::ptr_vector< Group > & getGroups() const
Definition: Schema.cpp:75
void addElement(Element *e)
Definition: Schema.cpp:150
Schema(std::string *id)
Definition: Schema.cpp:32
void addAttribute(AbstractAttribute *a)
Definition: Schema.cpp:145
void addNamespace(const std::string &ns, const std::string &nsprefix)
Definition: Schema.cpp:100
void addAttributeGroup(AttributeGroup *ag)
Definition: Schema.cpp:140
It models a XML Schema import.
Definition: Import.h:47
A class that models an XML Schema (XSD).
This class models the element of a XML Schema.
Definition: Element.h:56
const boost::ptr_vector< ComplexType > & getComplexTypes() const
Definition: Schema.cpp:70
It models a XML Schema include.
Definition: Include.h:46
void addImport(Import *i)
Definition: Schema.cpp:110
const boost::ptr_vector< Import > & getImports() const
Definition: Schema.cpp:50
const boost::ptr_vector< Notation > & getNotations() const
Definition: Schema.cpp:95
const boost::ptr_vector< Include > & getIncludes() const
Definition: Schema.cpp:45
It models a XML Schema redefine.
Definition: Redefine.h:52
This is the base class for XML Schema Attribute classes.
void addNotation(Notation *n)
Definition: Schema.cpp:155
const boost::ptr_vector< Element > & getElements() const
Definition: Schema.cpp:90
It models a XML Schema Complex Type definition.
Definition: ComplexType.h:56
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
void addComplexType(ComplexType *c)
Definition: Schema.cpp:130
const boost::ptr_vector< Annotation > & getAnnotations() const
Definition: Schema.cpp:60
void addRedefine(Redefine *r)
Definition: Schema.cpp:115
It indicates that the attribute attribute is not required to be qualified with the namespace prefix a...
Definition: Enums.h:115
const boost::ptr_vector< SimpleType > & getSimpleTypes() const
Definition: Schema.cpp:65
const boost::ptr_vector< AttributeGroup > & getAttributeGroups() const
Definition: Schema.cpp:80
const boost::ptr_vector< AbstractAttribute > & getAttributes() const
Definition: Schema.cpp:85
void addSimpleType(SimpleType *s)
Definition: Schema.cpp:125
A class that models a XSD annotation element.
Definition: Annotation.h:55
This class models a notation element from a XML Schema.
Definition: Notation.h:44
It models a XML Schema SimpleType element.
Definition: SimpleType.h:54
void addGroup(Group *g)
Definition: Schema.cpp:135
void addInclude(Include *i)
Definition: Schema.cpp:105
const boost::ptr_vector< Redefine > & getRedefines() const
Definition: Schema.cpp:55
This class models a group element in a XML Schema.
Definition: Group.h:52